code stringlengths 2 1.05M |
|---|
import React from 'react'
import TextInput from './TextInput'
import { shallow } from 'enzyme'
describe('(Component) TextInput', () => {
it('Should render as a <input>', () => {
const wrapper = shallow(<TextInput />)
expect(wrapper.is('input')).to.equal(true)
})
})
|
/*
this config file is used to configure the nw-ninja envelope, not the app itself
*/
var rc = require('rc')
module.exports = rc('nw-ninja', {
appDir: './nwapp',
files: './nwapp/**/**', // use the glob format
platforms: ['osx64', 'win32', 'win64', 'linux32', 'linux64'],
buildDir: './dist',
buildType: 'versioned'... |
/* Javascript porting of Markus Kuhn's wcwidth() implementation
*
* Copyright Tim Oxley <https://github.com/timoxley>
* license MIT
*
* file created using browserify, source at https://github.com/timoxley/wcwidth
*/
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;i... |
define([
'angular',
'underscore',
'./auth/module',
'./author/module',
'./character/module',
'./story/module',
'./universe/module',
'./core/module'
], function (angular, _, authModule, authorModule, characterModule, storyModule, universeModule, coreModule) {
"use strict";
var app... |
$(document).ready(function() {
$('.datepicker').pickadate({
selectMonths: true,
selectYears:true,
//format: 'yyyy-mm-dd',
onSet: function( arg ){
if ( 'select' in arg ){ //prevent closing on selecting month/year
this.close();
}
var d1 = $('#startdate').val();
... |
var Source = Backbone.Model.extend({
defaults: {
api_token: null,
rhoconnect_version: null,
seats: null,
issued: null,
source_id: null,
partition_type: null,
user_id: null,
doctype: null,
device_id: null
},
initialize: function(){
var session = new Session();
this.set('api_token', session.g... |
(function($) {
"use strict";
$.fn.pbTouchSlider = function(options) {
var slider_Opts = $.extend({
slider_Wrap : '', // Assign a unique ID to the div.o-sliderContainer
slider_Item : '.o-slider--item', // Single Item
slider_Item_Width : 90, // Single Item width in per... |
// var exports = module.exports = {};
var colors = [
{ hex: '#0247FE', dec: 0 },
{ hex: '#0391CE', dec: 25 },
{ hex: '#66B032', dec: 50 },
{ hex: '#D0EA2B', dec: 75 },
{ hex: '#FEFE33', dec: 100 },
{ hex: '#FABC02', dec: 125 },
{ hex: '#FB9902', dec: 150 },
{ hex: '#FD5308', dec: 175 },
{ hex: '#FE27... |
registerTest ('Product complaint', function () {
this
.test('Are required fields empty if product complaint?', function($) {
this.workspace.document.getElementById('enquirytype').value = "pc";
var runValidation = this.workspace.validateProductDetails();
ok(runValidation, "Passe... |
module.exports = function(Container) {
Container.observe('before save', function(ctx, next) {
console.log("Container before save observe");
/*
if (ctx.instance) {
console.log("token: " + ctx.instance.token);
ctx.instance.created = Date.now();
} else {
console.log("data token: " + ctx.dat... |
/* eslint-disable global-require */
const express = require('express');
const path = require('path');
// const compression = require('compression');
const pkg = require(path.resolve(process.cwd(), 'package.json'));
// Dev middleware
const addDevMiddlewares = (app, webpackConfig) => {
const webpack = require('webpack... |
function chat(sender, recipient, msg) {
const formattedMsg = color.bold.white(msg);
const label = color.bold.blue('CHAT');
return `${label}> ${sender.name}: "${formattedMsg}"`;
}
|
var messages = require('./messages');
var fs = require('fs');
// Make directory if NOT exist
module.exports = function mkDir (dstPath) {
try {
fs.mkdirSync(dstPath, fs.statSync(__dirname).mode);
messages.create(dstPath)
}
catch (e) {
// File exists
if (e.errno = 17) {
... |
import {
getNestedProperty,
deleteNestedProperty
} from './../src/';
describe('getNestedProperty', function () {
it('should get referenced value', function () {
const data = {aaa: 'bbb'};
expect(getNestedProperty(data, 'aaa')).toEqual('bbb');
});
it('should not throw if data is `undefined`', funct... |
'use strict';
angular.module('angularDemoApp')
.service('EmbeddableService', function($resource, $translate, appConfig, logger){
var service = {};
var resource = $resource(appConfig.restUrl + '/embeddables/v1/:id', { id: '@id' }, {
//query: {method:'GET', params:{}, isArray:true},
... |
#!/usr/bin/env node
/**
* Created by Keith Morris on 11/10/14.
*/
const fs = require('fs'),
hyperquest = require('hyperquest'),
promptUser = require('./lib/prompt-user'),
qs = require('querystring'),
unzip = require('adm-zip'),
yargs = require('yargs');
const url = "https://underscores.me/";
con... |
standaloneAddContents({
code: "castor_2015",
title: "Concours Castor 2015",
folder: "2015/",
tasks: [
{ code: "2015-JP-04-crane-operating",
title: "Piloter la grue" },
{ code: "2015-CZ-02-relationships",
title: "Relations d'âges" },
{ code: "2015-FR-02-spreading-secret",
ti... |
var date;
var tasksPending;
function getDay(day) {
var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday',
'Saturday'];
return days[date.getDay()];
}
function getMonth(month) {
var months = ['January','February','March','April','May','June','July',
'August','September','October','November',... |
/*
(The MIT License)
Copyright (C) 2005-2013 Kai Davenport
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify... |
// LidaCity, 2015-2016
var OptionLayer = {
attribution: ' © <a href="http://openstreetmap.org/copyright">Openstreetmap</a> | © <a href="http://streets.lidacity.by/">LidaCity</a>',
maxZoom: 18,
minZoom: 11,
maxBounds: [[53.80, 25.20], [54.00, 25.40]],
noWrap: true,
}
var Lang = Translate();
var Host ... |
(function() {
'use strict';
var snooze = require('snooze');
snooze.module('snooze-socket', ['snooze-controller', 'snooze-baselib'])
.registerEntityGroupsFromPath('entityGroups/*.js')
.registerEntitiesFromPath('entities/*.js');
})(); |
const debug = require('utils/getDebugger')('application');
import { browserHistory as history } from 'react-router';
import { showDelayedToastMessage } from 'ducks/messages/toastMessage';
import toastMessages from 'i18nDefault/toastMessages';
export const RELOAD_PAGE = 'application/application/RELOAD_PAGE';
const SHO... |
window.pdfMake = window.pdfMake || {}; window.pdfMake.fonts = {"TradeWinds":{"normal":"TradeWinds-Regular.ttf","bold":"TradeWinds-Regular.ttf","italics":"TradeWinds-Regular.ttf","bolditalics":"TradeWinds-Regular.ttf"}}; |
import { formatKeyForPlatform } from '../../application/formatKeyForPlatform.js';
import { DEFAULT_IN_INPUT } from '../../application/keyboardShortcuts.js';
import { toPlatformKey } from '../../application/toPlatformKey.js';
import { loc } from '../../localisation/i18n.js';
import { ViewEventsController } from '../View... |
//async icin yardimci fonksiyon
function delay(milliseconds, resolve) {
return new Promise(function (resolve) {
setTimeout(resolve, milliseconds);
});
}
//Burdaki T ODO ödev icin bir önemi yok, sadece gelecek icin kodu düzeltme acisindan yapilacaklar
//TODO: For Instructors only -> Replace all Maps with... |
var isFunction = require('lodash/lang/isFunction'),
isObjectLike = require('lodash/internal/isObjectLike');
/** Used to detect host constructors (Safari > 5). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used for native method references. */
var objectProto = Object.prototype;
/** Used to resolve the... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var feed = exports.feed = { "viewBox": "0 0 16 16", "children": [{ "name": "path", "attribs": { "fill": "#000000", "d": "M6 8c0-1.105 0.895-2 2-2s2 0.895 2 2c0 1.105-0.895 2-2 2s-2-0.895-2-2zM10.38 3.602c1.56 0.846 2.62 2.498 2.62 4.398s-1.... |
define({
title: 'Northwind Schema',
type: 'object',
properties: {
CustomerID: {
type: 'string',
filterable: true,
nullable: false,
required: true,
aggregateType: 'count',
},
EmployeeID: {
type: 'number',
filterable: true,
nullable: false,
required:... |
define([
'src/addsingletongetter'
], function (
addSingletonGetter
) {
describe('addSingletonGetter()', function () {
var instance;
function Dummy() {}
it('is a function', function () {
expect(addSingletonGetter).to.be.a('function');
});
it('adds the .getSingleton() static method to t... |
module.exports = MnSidenavCustomElement()
function MnSidenavCustomElement() {
const supportsCustomElements = 'customElements' in window
if (!supportsCustomElements) {
require('@webcomponents/custom-elements')
}
if (!window.customElements.get('mn-sidenav')) {
window.customElements.define('mn-sidenav',... |
/*!
* Copyright (c) 2016 Luminis
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, d... |
'use strict';
angular.module('<%=angularAppName%>')
.config(function ($stateProvider) {
$stateProvider
.state('login', {
parent: 'account',
url: '/login',
data: {
authorities: [],
pageTitle: 'login.title'
... |
// Generated by CoffeeScript 1.7.1
(function() {
var CSRFToken, Click, ComponentUrl, Link, browserCompatibleDocumentParser, browserIsntBuggy, browserSupportsCustomEvents, browserSupportsPushState, browserSupportsTurbolinks, bypassOnLoadPopstate, cacheCurrentPage, cacheSize, changePage, constrainPageCacheTo, createDoc... |
import React, { Component } from 'react';
import { TouchableHighlight, Text } from 'react-native';
import All from 'rnx-ui/All';
import ImgRollView from 'rnx-ui/ImgRollView';
import Alert from 'rnx-ui/Alert';
import { NavBar, Icon } from '../../component';
import Router from '../../router';
import style from './styl... |
var TextV = React.createClass({displayName: "TextV",
getInitialState: function(){
return {value: ''};
},
handleChange : function(e){
this.setState({value: e.target.value});
},
render: function () {
var value = this.state.value;
return(React.createElement("div", {className: "form-group"},
React.... |
'use strict';
var util = require('util');
var yeoman = require('yeoman-generator');
var BaseIndexGenerator = require('../sub-base.js');
var ModelServiceGenerator = module.exports = function JsonServiceGenerator(args, options, config) {
BaseIndexGenerator.apply(this, arguments);
console.log('Creating a model se... |
const ftime = function(timestamp) {
timestamp = new Date(timestamp).getTime()
var now = new Date(),
diff = now.getTime() - timestamp,
last = new Date(timestamp),
lastm = '0' + last.getMinutes();
var out = '';
if (diff < 60000) { //1分钟内
out = '刚刚';
} else if (diff >= 60000 && diff < 3600000)... |
module.exports = {
arc: require('./arc'),
circle: require('./ellipse').circle,
cube: require('./cuboid').cube,
cuboid: require('./cuboid').cuboid,
cylinder: require('./cylinderElliptic').cylinder,
cylinderElliptic: require('./cylinderElliptic').cylinderElliptic,
ellipse: require('./ellipse').ellipse,
el... |
import { module } from "qunit";
import startApp from "../helpers/start-app";
import destroyApp from "../helpers/destroy-app";
import { Promise } from "rsvp";
export default function(name, options = {}) {
module(name, {
beforeEach() {
this.application = startApp();
if (options.beforeEach) {
r... |
(function ($) {
"use strict";
/**
* Respaurant module implementation.
*
* @author Terrific Composer
* @namespace Tc.Module
* @class Respaurant
* @extends Tc.Module
*/
Tc.Module.Respaurant = Tc.Module.extend({
/**
* Initializes the Hero module.
... |
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
* Changes may cause incorrect behavior and will be lost if the code is
* regenerate... |
/**
* afterglow - An easy to integrate HTML5 video player with lightbox support.
* @link http://afterglowplayer.com
* @license MIT
*/
'use strict';
import Util from '../lib/Util';
class Config {
constructor(videoelement, skin = 'afterglow'){
return this.init(videoelement, skin);
}
init(videoelement, skin =... |
/* http://rosettacode.org/wiki/Fast_Fourier_transform */
var fft = function(arr){
var n = arr.length;
if(n <= 1){return arr;}
var h = n / 2;
var even = [];
var odd = [];
even.length = h;
odd.length = h;
for(var i = 0; i < h; ++i){
even[i] = arr[i*2];
odd[i] = arr[i*2+1];
}
even = fft(even)... |
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const activityTypeSchema = new Schema({
type: { type: String, unique: true, lowercase: true }
});
const ActivityTypeClass = mongoose.model('activityType', activityTypeSchema);
module.exports = ActivityTypeClass;
|
/**
* Rooms Controller
*
* @param {RoomRepository} repository
*/
function RoomsController(repository)
{
EventEmitter.call(this);
var controller = this;
this.socketGroup = new SocketGroup();
this.repository = repository;
this.onRoomOpen = this.onRoomOpen.bind(this);
this.onRoomClose... |
LionsShare.Collections.Listings = Backbone.Collection.extend({
model: LionsShare.Models.Listing,
url: '/listings',
getOrFetch: function (id) {
var listing = this.get(id),
listings = this;
if (!listing) {
listing = new LionsShare.Models.Listing({ id: id });
listing.fetch({
su... |
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ re... |
module.exports = {
siteMetadata: {
author: `Sidhartha Chatterjee`,
social: {
twitter: `chatsidhartha`,
},
},
plugins: [`gatsby-theme-about`, `gatsby-theme-local`, `gatsby-plugin-local`],
}
|
'use strict';
var Component = require('../../ui/Component');
var TextProperty = require('../../ui/TextPropertyComponent');
function Codeblock() {
Codeblock.super.apply(this, arguments);
}
Codeblock.Prototype = function() {
this.render = function($$) {
return $$('div')
.addClass('sc-codeblock')
.... |
import React from "react";
import { MDXProvider } from "@mdx-js/react";
import Main from "../components/Main";
import { NavIndex } from "../components/NavIndex";
import { NavTopics } from "../components/NavTopics";
import * as shared from "../shared";
import BasicLayout from "./BasicLayout";
export default function Wi... |
// All symbols in the Meetei Mayek block as per Unicode v9.0.0:
[
'\uABC0',
'\uABC1',
'\uABC2',
'\uABC3',
'\uABC4',
'\uABC5',
'\uABC6',
'\uABC7',
'\uABC8',
'\uABC9',
'\uABCA',
'\uABCB',
'\uABCC',
'\uABCD',
'\uABCE',
'\uABCF',
'\uABD0',
'\uABD1',
'\uABD2',
'\uABD3',
'\uABD4',
'\uABD5',
'\uABD6',
... |
const Promise = require('bluebird');
const util = require('util');
const FileUtil = require('../../lib/index').FileUtil;
const fs = require('fs');
const _path = require('path');
const _ = require('lodash');
describe("FileUtil", function () {
before(function () {
var variables = this;
variables.tem... |
angular.module('imageService', [])
.service('imageService', ['$http', function ($http) {
this.uploadFileToUrl = function(file, uploadUrl){
var fd = new FormData();
fd.append('file', file);
return $http.post(uploadUrl, fd, {
transformRequest: angular.identity,
headers... |
/*
* Copyright 2013-2015 Intel Corporation.
*
* See the file LICENSE for copying permission.
*/
/* jshint devel:true */
/* global define, $, brackets */
/**
* Provides XLint results via the core linting extension point
*/
define(function (require, exports, module) {
"use strict";
// Load dependent mod... |
let mainMenu = document.querySelector('#main_menu');
mainMenu.addEventListener('click', function() {
ipcRenderer.send('main-screen');
});
ipcRenderer.on('load-error', (event, data) => {
$("#error_message").html(data);
$('.progress-bar-fill').fadeIn();
$('.progress-bar-fill').delay(10).queue(function () {
... |
var searchData=
[
['off_5fabs_5fflag_5fctx',['OFF_ABS_FLAG_CTX',['../contexts_8h.html#afb7adcbadcba955cca366b5b6341fd70',1,'contexts.h']]],
['off_5fadi_5fctx',['OFF_ADI_CTX',['../contexts_8h.html#a8e3ba8d9afec533dda645294862079e1',1,'contexts.h']]],
['off_5fchroma_5fpred_5fctx',['OFF_CHROMA_PRED_CTX',['../context... |
/*jslint browser: true, devel: true, sloppy: true, plusplus: true */
/*global GlucoDiary, document, GDoptions */
GlucoDiary.ReadLocalStorage = function () {
var i, propertyName, insulinData, carbsData, glucoseData, bkgndData, dateString, dSFmt, dateTodayOffset, itemColor, itemNameString, dataOutputString;
data... |
/* -*- Mode: jasmine; tab-width: 4; indent-tabs-mode: nil; */
//--------MODULE HEADER----------
(function(GLOBAL, undefined) {
"use strict";
//===============================
var attributeUniverseReference = null, wrapper;
var setAttributeUniverse = function(attrUniverse) {
if(! attrUniverse)... |
'use strict';
/**
* @ngdoc function
* @name argentumWebApp.service:transactionService
* @description
* # transactionService
* Service that gets Transaction info from the Api
* @requires commonService
* @author Daniel Hoyos <dhoyosm@gmail.com>
*/
angular.module('argentumWebApp')
.service('transactionService',... |
/* globals menu*/
Template.sideNav.helpers({
flexTemplate() {
return SideNav.getFlex().template;
},
flexData() {
return SideNav.getFlex().data;
},
footer() {
return RocketChat.settings.get('Layout_Sidenav_Footer');
},
roomType() {
return RocketChat.roomTypes.getTypes();
},
canShowRoomType() {
i... |
/* */
"format cjs";
(function(factory) {
if (typeof define === 'function' && define.amd) {
define(["moment"], factory);
} else if (typeof exports === 'object') {
module.exports = factory(require("../moment"));
} else {
factory((typeof global !== 'undefined' ? global : this).moment);
}
}(function(mo... |
"use strict";
////////////////////////////////////////////////////////////////////////////////
// アカウント設定
////////////////////////////////////////////////////////////////////////////////
Contents.accountset = function( cp )
{
var p = $( '#' + cp.id );
var cont = p.find( 'div.contents' );
cp.SetIcon( 'icon-user' );... |
/**
* Using the "gulp" command in NodeJS will pull in a source file and pass through a designated plugin module and output the processed code in the destination location.
* IMPORTANT! It is not recommended to run individual gulp tasks in this scrip from the command line. Safest route is to let the watcher handle w... |
export const LOAD_RECIPE_SUCCESS = 'LOAD_RECIPE_SUCCESS';
export const LOAD_ONE_RECIPE = 'LOAD_ONE_RECIPE';
export const GET_VOTE = 'GET_VOTE';
export const GET_REVIEW = 'GET_REVIEW';
export const GET_MESSAGE = "GET_MESSAGE";
export const LOAD_ALL_REVIEWS = "LOAD_ALL_REVIEWS";
export const LOAD_PAGINATE = "LOAD_PAGINA... |
/**
* @license
* Copyright 2017 Google Inc.
*
* 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 applica... |
import gql from 'graphql-tag';
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import cx from 'clsx';
const useStyles = makeStyles(theme => ({
root: {},
progressBar: {
border: `1px solid ${theme.palette.secondary[300]}`,
borderRadius: 6,
padding: 2,
},
progress: {
... |
module.exports = {
context: {
class: 'margin-vc-m',
sidebarClass: 'dashboard__sidebar margin-top-sl',
contentClass: 'dashboard__content margin-top-sl',
breadcrumbs: {
categories: [
{
name: 'Home',
href: '#',
linkClass: 'breadcrumbs__link'
},
... |
import styled from 'styled-components';
import {connect} from 'react-redux';
import {createStructuredSelector} from 'reselect';
import {makeSelectCurrentProfile} from 'containers/HomePage/selectors';
import {
PROFILE_NOW
} from 'containers/HomePage/constants';
const H2 = styled.div`
background-color: ${props =... |
'use strict';
var BarChart = require('./charts/Bar.js');
var LineChart = require('./charts/Line.js');
var DonutChart = require('./charts/Donut.js');
var data = [{
label: 'Jan',
data: 35
}, {
label: 'Feb',
data: 20
}, {
label: 'Mar',
data: 28
}, {
label: 'Apr',
data: 8
}, {
... |
/*
* This setup script is run after the first install. It creates
* the first user account based on env variables provided during
* the deployment.
*/
var mongoose = require('mongoose');
var models = require('../models'),
config = require('./config');
mongoose.connect(config.dbUrl);
mongoose.connection.on('o... |
import HttpServer from './interfaces/http'
import SocketServer from './interfaces/websocket'
// TODO: add HTTP/2
// TODO: add HTTPS
export default class InterfaceHandler {
constructor (modulesHandler, port = 8080, socketEnabled = true) {
this.modulesHandler = modulesHandler
this.port = port
this.socketEn... |
var instagramUtil = require('jp.msmc.tiinstagramutil');
var window = Ti.UI.createWindow({});
var caption = Ti.UI.createTextField({
top:50,
width:240,
height:40,
hintText:'Enter caption here',
borderStyle:Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
});
window.add(caption);
var button = Ti.UI.createButton({
title:'Open phot... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* @author Alvaro Martinez de Miguel (Demi) [demipel8@gmail.com]
*/
var endpoint = 'designs';
exports.default = function (Request) {
var options = {
uri: '' + endpoint,
method: 'POST'
};
design.get = get;
return {
design:... |
require("sdk/preferences/service").set("javascript.options.strict", false);
// Import the page-mod API
var pageMod = require("sdk/page-mod");
// Import the self API
var self = require("sdk/self");
// Create a page mod
// It will run a script whenever a ".org" URL is loaded
// The script replaces the page contents wit... |
import React from "react";
import PropTypes from "prop-types";
import styled from "styled-components";
import Container from "../BlockContainer";
import Navbar from "../Navbar";
const Outer = styled.div`
background-color: #fff;
padding-bottom: 1em;
`;
const Inner = styled.div`
text-align: left;
border-bottom:... |
var cmdr = require('commander')
var version = require('../package.json').version
var levelup = require('levelup')
var args = process.argv
if (args.length <= 2) {
args.push('-h')
}
cmdr
.version(version)
.usage('<databaseName> [options]')
.option('-d, --data [value]', 'specify data')
.option('-k, --key [valu... |
version https://git-lfs.github.com/spec/v1
oid sha256:6e35e6cf48da093798086c5146583e6bd90960cd630538f8aee2a79393066a62
size 2200
|
var RuneTx = RuneTx || {};
RuneTx.GameBoard = function(props) {
props = props || {};
this._gameEngine = props.gameEngine;
this._screenContext = props.screenContext;
this._boardOffsetX = props.boardOffsetX || 0;
this._boardOffsetY = props.boardOffsetY || 0;
this._cellWidth = props.cellWidth;
this._cellHei... |
// JavaScript 运行机制详解:再谈Event Loop
// http://www.ruanyifeng.com/blog/2014/10/event-loop.html
// 除了放置异步任务的事件,"任务队列"还可以放置定时事件,即指定某些代码在多少时间之后执行。
// 这叫做"定时器"(timer)功能,也就是定时执行的代码。
// 定时器功能主要由setTimeout()和setInterval()这两个函数来完成,
// 它们的内部运行机制完全一样,区别在于前者指定的代码是一次性执行,后者则为反复执行。
// 以下主要讨论setTimeout()。
// setTimeout()接受两个参数,第一个是回调... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = precss;
var _identity = require('utilise/identity');
var _identity2 = _interopRequireDefault(_identity);
var _client = require('utilise/client');
var _client2 = _interopRequireDefault(_client);
var _values = require('... |
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
"_decimalSeparator": ",",
"_thousandSeparator": " ",
"_big_number_suffix_3": "k",
"_big_number_suffix_6": "M",
... |
var express = require('express')
, app = express()
, server = require('http').Server(app)
//, bodyParser = require('body-parser')
, config = require('./lib/config')
;
//app.use(bodyParser.json());
//app.use(bodyParser.urlencoded({ extended: true }));
// Web interface
//app.get('/user/:id', users.userPage);
... |
function includeTheme(tab) {
addThemeToTab(tab, ThemeStorage.getCurrent());
}
function addThemeToTab(tab, themeName) {
chrome.tabs.insertCSS(tab.id, { file: "src/themes/" + themeName + ".css" });
}
chrome.tabs.onUpdated.addListener(function (tabID, changeInfo, tab) {
if (tab.url && changeInfo.status === "loadin... |
export const DEFAULT_PANEL_WIDTH = 6;
export const DEFAULT_PANEL_HEIGHT = 3;
/**
* Represents a panel on a grid. Keeps track of position in the grid and what visualization it
* contains.
*
* @typedef {Object} PanelState
* @property {number} id - Id of the visualization contained in the panel.
* @property {Elemen... |
'use strict';
var _createClass = 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.definePrope... |
System.register(['aurelia-framework'], function (_export) {
'use strict';
var bindable, customElement, Test;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
return {
setters: [function (_aureliaFramework) ... |
/**
* @fileOverview This file initializes the modal button (browser action).
* This file initializing the button's state on browser start and
* change button's state (badage color and text) when user toggles
* injection in popup.html.
*
* The text message on the button determines the operating mode.
* "off" ind... |
export default from './Flex';
export FlexItem from './FlexItem';
|
// Object.js
'use scrict';
Object.prototype.toBuffer = function () {
return (Buffer.isBuffer(this)) ? this : new Buffer(JSON.stringify(this));
};
Object.prototype.toObject = function () {
return (Buffer.isBuffer(this)) ? JSON.parse(this.toString()) : this;
};
|
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.ex... |
'use strict';
var views = require('co-views');
var assets = require('koa-static-folder');
var logger = require('koa-logger');
var route = require('koa-route');
var koa = require('koa');
var parser = require('co-body');
var KoaApplication = require('./KoaApplication');
const PUBLIC_PATH = './public';
var KoaApplicati... |
var canvas = require("./canvas");
var keysDown = require("./input").keysDown;
var mainMenu = require("./menu/mainMenu");
var Player = require("./player");
var Confirmation = require("./confirmation");
var scoreTracker = require("./scoretracker");
var overlay = require("./ov... |
var path = require('path')
, fs = require('fs-extra')
, chai = require('chai')
, should = require('chai').should()
, chaifs = require('chai-fs')
, Skeleton = require('../../lib')
chai.use(chaifs)
chai.should();
describe('Skeleton', function() {
var scope = {
generator : __dirname ... |
'use strict';
var React = require('react');
var IconBase = require(__dirname + 'components/IconBase/IconBase');
var SoupCan = React.createClass({
displayName: 'SoupCan',
render: function render() {
return React.createElement(
IconBase,
null,
React.createElement(
'g',
null,
React.createElemen... |
import React from 'react';
import styles from './Footer.css';
import darkSkyImg from './../../images/darksky.png';
export default function Footer() {
return (
<footer className={styles.block}>
<a href="https://darksky.net/poweredby/" target="_blank">
<img src={darkSkyImg} alt="logo" width="200"/>
</a>... |
/**
*
* @license MIT License Copyright (c) 2017 Abhijit Gurav
* @author Abhijit Gurav, https://github.com/abhijit-g/
*
*/
angular.module("race")
.constant("carDirection", {
none: 0,
up : 1,
down : 2,
left : 3,
right: 4
}); |
'use strict'
const he = require('he')
const node = require('./node')
const debug = require('debug')('arraydom.toHTML')
const pad = Array(80).join(' ') // don't bother to indent more than 80
const selfClosing = {
// from http://xahlee.info/js/html5_non-closing_tag.html
// These are the tags that don't need an e... |
import _extends from 'babel-runtime/helpers/extends';
import cx from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps, META } from '../../lib';
/**
* A list item can contain a description.
... |
config.module.rules.push(
{
test: /\.ttf$/,
loader: 'file-loader',
options: {
name: 'fonts/[name].[ext]'
}
}
);
|
// 8 bits, no parity, 1 stop bit
// [0abcdefg][h10abcde][fgh10abc][defgh10a][bcdefgh1]
module.exports = Frame;
function Frame (opts) {
if (!(this instanceof Frame)) return new Frame(opts);
if (!opts) opts = {};
this._stop = opts.stop === undefined ? 1 : opts.stop;
this._queue = [];
this._inde... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.