code stringlengths 2 1.05M |
|---|
// Start Wiki Based Functions --------------------------------------------------
// Creates and inserts the link to a wikipedia and wiktionary search
function lookup(lookingFor) {
var logoBox = $("leftnav");
var p = $create("p", {
textContent : "Find " + lookingFor + " on ",
className : 'added',
id : 'wikiLin... |
// from jsperf.com/pixel-interpolation/14 (2014-09-08)
function clamp(lo, value, hi) {
return value < lo ? lo : value > hi ? hi : value;
}
function nearest(pixels, x, y, offset, width) {
return pixels[offset + Math.round(y) * width * 4 + Math.round(x) * 4];
}
function nearest_unrolled(pixels, x, y, width) {
va... |
var types = require('../types');
var object = types.createObject;
var key = types.createObjectKey;
var prop = types.createObjectProperty;
var array = types.createArray;
var string = types.createString;
var number = types.createNumber;
var _true = types.createTrue;
var _false = types.createFalse;
var doc = types.createD... |
/*
* Majiang.He
*/
"use strict";
const Majiang = {
Shoupai: require('./shoupai')
};
module.exports = class He {
constructor() {
this._pai = [];
this._find = {}
}
dapai(p) {
if (! Majiang.Shoupai.valid_pai(p)) throw new Error(p);
if (p.match(/[\+\=\-]$/)) throw new Error(p);
thi... |
import React, { Component, PropTypes } from 'react';
import { StyleSheet, View, Text, TouchableHighlight } from 'react-native';
class OvalButtonComp extends Component {
static propTypes = {
borderColor: PropTypes.string,
textColor: PropTypes.string,
onPress: PropTypes.func,
};
render() {
retur... |
/*
Creates tag for targetting things with a path in Cerebral
*/
export default class Tag {
constructor (tag, options = {}, strings, values) {
options.hasValue = options.hasValue === undefined ? true : options.hasValue
this.type = tag
this.options = options
this.strings = strings
this.values = v... |
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Refl... |
define(['jquery', 'backbone', 'marionette', 'underscore', 'layouts/RootLayoutView'],
function ($, Backbone, Marionette, _, RootLayoutView) {
var App = new Backbone.Marionette.Application();
App.rootLayout = new RootLayoutView({
regions: {
headerRegion:"#global-header",
... |
var classstd_1_1vector =
[
[ "allocator_type", "dd/d4e/classstd_1_1vector.html#a8cb9a89bdee041141774c3a7a7215846", null ],
[ "const_iterator", "dd/d4e/classstd_1_1vector.html#a9a86b199a9bbe1db05e061b4f709402d", null ],
[ "iterator", "dd/d4e/classstd_1_1vector.html#a1f644e678ac05664c6353437c58111bf", null ],... |
"use strict";
// HTTP authentication scheme.
const httpScheme = (server, auth) => {
return {
authenticate: (request, reply) => {
// Is auth.
auth.isAuthenticated(request, (result) => {
if (result instanceof Error) {
return reply(result, n... |
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
const environment = require('./environment')
const chokidar = require('chokidar')
environment.config.devServer.before = (app, server) => {
chokidar.watch([
'config/locales/*.yml',
'app/views/**/*.erb'
]).on('change', () => server.sockWrite(serve... |
'use strict';
// Declare app level module which depends on views, and components
angular.module('myApp', [
'ngRoute',
'myApp.home',
'myApp.createdeck',
'myApp.version',
'myApp.decks'
]).
config(['$routeProvider', function($routeProvider) {
$routeProvider.otherwise({redirectTo: '/home'});
}]);
|
/**
* @licence MIT
* @author Louis Audeon <louis.audeon@mail.be>
*/
'use strict'
const util = require('util')
const validator = require('validator')
const Fieldformat = require('./../fieldformat')
function Emailformat () {
Fieldformat.call(this)
this.name = 'email'
this.error = null
}
util.inherits(Emailfor... |
import React from 'react';
import { shallow, render } from 'enzyme';
import { expect } from 'chai';
import Technology from './Technology.jsx';
describe('<Technology />', () => {
it('should contain a heading of "Current tech stack of choice"', () => {
const expected = 'Current tech stack of choice';
const w... |
'use strict';
// MODULES //
var isObject = require( 'validate.io-object' ),
isBoolean = require( 'validate.io-boolean-primitive' );
// VALIDATE //
/**
* FUNCTION: validate( opts, options )
* Validates function options.
*
* @param {Object} opts - destination for validated options
* @param {Object} options - functi... |
const _ = require('lodash');
const s = require('../lib/spec');
const testcheck = require('testcheck');
const {isInteger, isString, isDate} = s.utils;
// Simple definition of a predicate
const genPred = () => testcheck.gen.oneOf([isInteger, isDate, isString, s.tuple(isInteger), s.alt(':s', isString)]);
const isPred =... |
/**
* @license Copyright (c) 2012, Viet Trinh All Rights Reserved.
* Available via MIT license.
*/
/**
* A IoC DI definition for the client.
*/
define([ 'domain/definition/shared_definition',
'underscore',
'framework/application/backbone_client_application',
'framework/request/ajax_request_handler_execu... |
// ==UserScript==
// @name Toon TJV teller in dagen
// @namespace https://github.com/kdw2060/XtremisHack
// @version 0.1
// @description lets make it easier for ourselves
// @author kdw2060
// @include *xtremissrv.pa.be*
// @grant none
// ==/UserScript==
(function() {
'use strict... |
import request from 'superagent';
import { Promise } from 'es6-promise';
import authVars from '../../auth0-variables';
const baseUrl = `http://${authVars.VOYAGEUR_API_SERVER}`;
export function fetchEvents( token ) {
return new Promise( ( resolve, reject ) => {
const url = `${baseUrl}/admin/events`;
request.... |
var html = '<label>name:</label><input id="name" type="input"><br><button onclick="next()">next step</button>'
var opt = {
templateId: 'step1',
view: 'viewport',
html: html,
script: '/example/js/app/step1.js'
}
smartRouter.nav(opt) |
export default {
/**
* Calculates the desired number of nodes to render
*/
_idealnodeCount: {
/**
* Ensure usable `nodeCount` is numeric
* @return {Number}
*/
get () {
const result = parseInt(this.nodeCount, 10);
if (isNaN(result)) {
throw new Error('Nayuki Canvas... |
'use strict';
const ReactNative = require('react-native');
const {
NativeModules,
} = ReactNative;
const RCTImagePicker = NativeModules.ImagePicker;
const ImagePicker = {
getPictures:function (options, successCallback, errorCallback) {
options = options || {};
successCallback = successCallbac... |
'use strict'
function sw(e, i) {
var movie = e.parentNode.parentNode.parentNode.parentNode
var dsc = movie.getElementsByClassName('dsc')[0]
var tor = movie.getElementsByClassName('tor')[0]
var inf = movie.getElementsByClassName('inf')[0]
var t0 = document.getElementById('t0')
var t1 = document.getElementBy... |
/**
* Created by cmeyers on 9/15/16.
*/
import {
capabilityAugmenter as augmenter,
capabilityStore as store,
} from '@jenkins-cd/blueocean-core-js';
/**
* Utilities for setting up test data with associated capabilities.
*/
export class CapabilityTestUtils {
/**
* Bind the supplied className to the... |
var gulp = require('gulp');
var browserify = require('browserify');
var watchify = require('watchify');
var source = require('vinyl-source-stream');
var glob = require('glob');
var open = require("gulp-open");
var path = require('path');
var gutil = require('gulp-util');
gulp.task('bundle:app', bundleAppWith(browserif... |
"use strict";
var path_1 = require('path');
var config_1 = require('../config');
module.exports = function watchDev(gulp, plugins) {
return function () {
plugins.watch(path_1.join(config_1.APP_SRC, '**/*'), function () { return gulp.start('build.dev'); });
};
};
|
requirejs.config({
packages: [
{
name: 'foo',
main: 'main'
}
]
});
define(['foo'], function (foo) {
return foo;
});
|
const assert = require('assert');
const accounts = require('../../src/lib/gnucash/balance')({
path: `${__dirname}/../assets/example.gnucash`
});
describe('Balance', function () {
describe('#balance()', function () {
it('Should return 4 root accounts', function () {
assert.equal(2, accounts.length);
... |
var crypto = require('crypto');
module.exports.encrypt = function (stringToEncrypt)
{
var cipher = crypto.createCipher('aes-256-cbc', 'tsy381');
var encryptedString = cipher.update(stringToEncrypt, 'utf8', 'hex');
encryptedString += cipher.final('hex');
return encryptedString;
}
module.exports.decrypt = function ... |
/* eslint-disable no-undef */
const {assert, expect} = require('chai');
const tagSuggestion = require('../src/backend/model/tag-suggestion.js');
const Tag = require('../src/backend/model/tag');
const storeLib = require('../src/backend/store/store');
/**
* @type {TMD.Store} a test data store
*/
let store = storeLib.... |
/**
* @author lijh
* copyright 2015 Qcplay All Rights Reserved.
* https://github.com/pixijs/pixi-extra-filters/blob/master/src/filters/glow/GlowFilter.js
*/
/**
* 外发光
*/
var Glow = defineFilter('qc.Filter.Glow', qc.Filter, function(game) {
this.distance = 40;
this.outerStrength = 1.5;
this.innerStren... |
import React, { Component } from 'react';
// import renderer from 'react-test-renderer';
import { render } from 'react-dom';
import Popover from '../../src/popover';
class TestPopover extends Component {
constructor(props) {
super(props);
this.state = {
show: true,
};
}
componentDidMount() {
... |
module.exports = [
{
"name": "The Shawshank Redemption",
"outline": "Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency.",
"rating": 9.3,
"director": "Frank Darabont",
"year": 1994,
"stars": [
"Tim Robbins",
"Morgan... |
var namespace_oxy_engine =
[
[ "Ecs", "namespace_oxy_engine_1_1_ecs.html", "namespace_oxy_engine_1_1_ecs" ],
[ "Events", "namespace_oxy_engine_1_1_events.html", "namespace_oxy_engine_1_1_events" ],
[ "Graphics", "namespace_oxy_engine_1_1_graphics.html", "namespace_oxy_engine_1_1_graphics" ],
[ "Input", ... |
var Container = require('../display/Container'),
Sprite = require('../sprites/Sprite'),
Texture = require('../textures/Texture'),
CanvasBuffer = require('../renderers/canvas/utils/CanvasBuffer'),
CanvasGraphics = require('../renderers/canvas/utils/CanvasGraphics'),
GraphicsData = require('./Graphics... |
$(function() {
$("#results2").delegate('td[colname]','mouseover mouseleave', function(e) {
if (e.type == 'mouseover') {
$(this).parent().not(".titles").addClass("hover");
$("td[colname='"+$(this).attr("colname")+"']").not(".rowtitle").addClass("hover");
$(this).not... |
// No need for the line below if your environment already supports ES6 with JavaScript import/export
require('babel-register');
// change the line below to:
// const SteemBot = require('steem-bot').default
// or:
// import SteemBot from 'steem-bot';
const SteemBot = require('../src/loader').default;
const username =... |
/*
Copyright (c) 2016-2017, Finnish Environment Institute SYKE All rights
reserved.
Redistribution and use, 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 discl... |
/**
* __ _ __ ____
* / / | |/ // __ \
* / / | // / / /
* / /___/ |/ /_/ /
* /_____/_/|_/_____/
*
* @author Alan Doherty (BattleCrate Ltd.)
* @license MIT
*/
// requires
var utils = require('../utils');
// operation error
var OperationError = utils.class_('OperationError', {
/**
* @pr... |
const SegmentParser = require('./lib');
const headerRecord = require('./configs/headerRecord.json');
const baseSegment = require('./configs/baseSegment.json');
const headerSample =
'0560HEADER341234567890 333333333303162017100419840701201707022017BANANAS FOR LYFE 1234 MAIN ST NOT... |
'use strict';
// @ifdef DEBUG
/**
* Provide functions to interact with tests.
*/
// eslint-disable-next-line no-unused-vars
const TestReporter = {
/**
* Notify the test that connector is injected.
* @param {Object} connector Injected connector
*/
reportInjection(connector) {
this.sendEventToTest('connec... |
(function() {
const defDirectory = require('electron').remote.app.getPath('desktop');
const fs = require('fs'); // Node.js file system API
const path = require('path'); // Node.js file system API for path browsing
const rimraf = require('rimraf');
angular.module('folder-remover')
.config(configCurrentRouteFn)
... |
"use strict"
module.exports = guardQueue
function guardQueue(fn, guardFn) {
if (fn.__guardFns) {
fn.__guardFns.push(guardFn)
return fn
}
var fns = guard.__guardFns = guard.__guardFns || []
fns.push(guardFn)
function guard() {
var args = arguments
var ok = fns.every(function(test) {
... |
//~ name a359
alert(a359);
//~ component a360.js
|
module.exports = require('./lib/testService'); |
'use strict';
angular.module('mean.lights').controller('LightsController', ['$scope', 'Global', 'Lights', 'MeanSocket',
function ($scope, Global, Lights, MeanSocket) {
$scope.global = Global;
$scope.package = {
name: 'lights'
};
$scope.fixture = {};
$scope.fixt... |
import pkgcloud from "pkgcloud";
export default class AmazonReleaseDownloader {
constructor(key, secret, region) {
this.client = pkgcloud.storage.createClient({
provider: "amazon",
keyId: key,
key: secret,
region
});
}
async download(app, rel... |
import React from 'react';
import './Navigator.css';
const Navigator = (props) => (
<button className="navigator"
data-tap="true"
onClick={props.onClick}
>
<div className={props.isMobile ? "icon-next" : "icon-down"}>
</div>
</button>
);
export default Navigator; |
"use strict";
import ActionTypes from './actionTypes.js';
import api from '../api/api.js';
import Cookies from 'js-cookie';
import moment from 'moment';
import User from '../models/User.js';
import {fbRef} from '../firebase/index.js';
import modalDialogActions from './modalDialogActions.js';
import mathGameActions f... |
/**
* ALGO.Rectangle
*/
ALGO.Rectangle = function( _x, _y, _width, _height ) {
'use strict';
// ALGO.log( 'ALGO.Rectangle' );
this.x = _x;
this.y = _y;
this.width = _width;
this.height = _height;
// define
this.width_ = _width;
this.height_ = _height;
this.type = 'rectangle';
... |
// Copyright (c) 2016 Uber Technologies, 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 applicable law or agre... |
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.16/esri/copyright.txt for details.
//>>built
define({widgetLabel:"Laajenna"}); |
// Generated by CoffeeScript 1.4.0
(function() {
var REDIS_SERVER, SECURE, ca, certificate, fs, io, log, privateKey, redis;
fs = require('fs');
redis = require('redis');
log = require('./log.js');
REDIS_SERVER = process.env.NODE_ENV === 'development' ? 'localhost' : 'db12';
SECURE = !!process.env.NODE_... |
enyo.kind({
name: "MainView.GameView",
kind: "FittableRows",
classes: "onyx",
published: {
game: null
},
components: [
{ fit: true, name: "gameMain", classes: "gameMain", id: "gameMain" }
],
create: function () {
this.inherited(arguments);
},
rendered: f... |
import Ember from 'ember';
import CategoriesListRouteMixin from 'letnar-frontend/mixins/categories-list-route';
module('CategoriesListRouteMixin');
// Replace this with your real tests.
test('it works', function() {
var CategoriesListRouteObject = Ember.Object.extend(CategoriesListRouteMixin);
var subject = Categ... |
/**
* Created by jim on 2015/3/17.
*/
angular.module('app.services').factory('ServiceInstance', ['$resource', function($resource) {
return $resource('/service_instances/:guid', {
guid: '@guid'
}, {
});
}]);
angular.module('app.services').factory('Service', ['$resource', function($resource) {
return $res... |
'use strict';
function generateCheckDigit(noHyphenOrcid) {
// https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier
let total = 0;
let zero = '0'.charCodeAt(0);
for (let i = 0; i < 15; i++) {
let digit = noHyphenOrcid.charCodeAt(i) - zero;
total = (total + digit) * ... |
"use strict";
/* Support a prefix key with multiple suffix keys */
/* For licensing information, refer to LICENSE.md. */
function PrefixKey(key, modifiers, description) {
this.modal = this.centeredModal(description);
this.suffixes = [];
this.handlers = [];
var that = this;
this.prefix = new Key(ke... |
var ghpages = require('gh-pages');
ghpages.clean();
|
var path = require('path');
module.exports = function test(config) {
config.set({
files: [
'test/**/*.spec.js'
],
preprocessors: {
'test/**/*.spec.js': ['webpack']
},
frameworks: ['mocha'],
browsers: ['PhantomJS'],
singleRun: true,
reporters: ['spec', 'coverage'], // spec ... |
import valid from '../valid/valid.js';
const events = (() => {
const VALID = valid,
WINDOW_VALID = typeof window === 'object' && window !== null;
/**
* @property {object} SUBSCRIPTIONS A collection of events and their subscribers
* @constant
* @memberof spookui.events
* @private
*/
const SUBSCRIPTIONS =... |
/*!
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com
Version 1.4.2
Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011-2015 Harvest http://getharvest.com
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
This file is ge... |
'use strict';
var path = require('path');
var _ = require('lodash');
function requiredProcessEnv(name) {
if(!process.env[name]) {
throw new Error('You must set the ' + name + ' environment variable');
}
return process.env[name];
}
// All configurations will extend these options
// =========================... |
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @flow
*/
import invariant from 'shared/invariant';
import {
injectEventPluginOrder,
injectEventPluginsByName,
plugins,
} fr... |
import React from 'react'
import { storiesOf } from '@storybook/react-native'
import Standard from './standard'
import Horizontal from './horizontal'
import Grouped from './grouped'
import GroupedHorizontal from './horizontal-grouped'
import WithGradient from './with-gradient'
import WithYMinMax from './with-y-min-max... |
module.exports = function(err, lint) {
var repport = {};
if (err) {
repport.errors = err.map(function(e) {
if (typeof e === 'string') {
return {
message: e
};
} else {
return {
message: e.message,
stack: e.stack
};
}
});
}
if (lint.length) {
repport.lint = lint.map(func... |
const _ = require('lodash')
const Vue = require('vue/dist/vue.js')
const app = require('../core/app')
const routy = require('routy')
const auth = require('../core/auth')
const filters = require('../filters')
const arrayUtil = require('../../common/util/array')
const controllerUtil = require('../util/controller')
const ... |
import { renderComponent, expect } from "../../test_helper";
import SplashPage from "../../../components/splash/SplashPage";
describe("SplashPage", () => {
let component;
beforeEach(() => {
component = renderComponent(SplashPage, { formType: "signup" });
});
it("wraps the page", () => {
expect(compon... |
angular
.module('bankRoll')
.controller('RegisterCtrl', function ($scope, $location, API_URL, $http, currentUser, $rootScope) {
var vm = this;
vm.login = function (email, password) {
var fb = new Firebase(API_URL);
fb.authWithPassword({
email: vm.email,
password: vm.password
... |
import Immutable from 'immutable'
import {createAction, handleActions} from 'redux-actions'
import api from 'api'
const GET_RECIPES = 'GET_RECIPES'
const CREATE_RECIPE = 'CREATE_RECIPE'
const DELETE_RECIPE = 'DELETE_RECIPE'
const UPDATE_RECIPE = 'UPDATE_RECIPE'
export const fetchRecipes = createAction(GET_RECIPES, ap... |
// Inside our freshly created file, let's add the test block:
describe( 'Controller: NavbotCtrl', function() {
// We need to tell it what module we are testing
beforeEach( module( 'totoro' ) );
// Next, we're going to pretend that we're angular loading the controller when it needs to be instantiated on the ... |
this.NesDb = this.NesDb || {};
NesDb[ 'B6904BEC7AF8E4E526073DD1752D60494E7E21E1' ] = {
"$": {
"name": "Tao",
"altname": "究極の世紀末ロープレ 道",
"class": "Licensed",
"catalog": "VAP-BY",
"publisher": "Vap",
"developer": "Pax Softnica",
"region": "Japan",
"players": "1",
"date": "1989-12-01"
},
"cartridge":... |
/* @jsx h */
const { h, render } = preact
const { useState } = preactHooks
const App = () => {
const [count, setCount] = useState(0)
const inc = () => setCount(count + 1)
const dec = () => setCount(count - 1)
return (
<div>
<h2>{count}</h2>
<button onClick={inc}>Increment</button>
<but... |
/*Scripts starts*/
$(document).on('ready', function () {
'use strict';
//Vertical icon-menu active script
$('.horizontal_iconmenu li').on('click', function () {
$('.page-top').removeClass('display_none');
$('.wow').attr('style', 'visibility: hidden; animation-name: none; -webkit-transf... |
import _ from 'lodash';
import {FACE} from '../../constants/Cube';
import {
filterCubes,
oppositeFace,
getBaseColorFace,
topLayerMovesFromTo,
rotateCubeHorizontallyFromTo,
findCenterFaceOfColor,
horizontalFaceDifference,
} from '../cube';
function _findMiddleEdgePair(cubes) {
const topColor = _.values(... |
import Notifier from "src/event/Notifier";
import utils from "src/utils/Utils";
import uriUtils from "src/utils/Uri";
import Logger from "src/modules/Logger";
class XHR extends Notifier {
constructor(method, url, data) {
super();
this.init(method, url, data);
}
init(method, url, data) {
method =... |
/**
* @file 二值图像开运算
* 先膨胀后腐蚀的过程称为闭运算。用来填充物体内细小空洞、
* 连接邻近物体、平滑其边界的同时并不明显改变其面积
* @author mengke01(kekee000@gmail.com)
*/
import dilate from './dilate';
import erode from './erode';
export default function close(imageData, mode, radius) {
return erode(dilate(imageData, mode, radius));
}
|
/*
Feature class for features that fire (or don't) on combinations of context
and class
Copyright (C) 2017 Hugo W.L. ter Doest
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, ... |
/**
* Copyright (c) 2015, Marco Grätsch <magdev3.0@gmail.com>
* All rights reserved.
*
* 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
* ... |
module.exports = function(gulp, functions, $, paths, config, flags){
var files = functions.loadBowerFiles();
files.push(paths.srcJs);
var scriptsConcatenationOrder = functions.buildScriptsConcatenationOrder(config.scriptSettings.concatenation.order);
return gulp.src(files)
.pipe($.cond(... |
angular.module('create', ['ngRoute'])
.controller('productCreateController', function($scope, $location, $routeParams, gs1Factory) {
$scope.createProduct = function (){
gs1Factory.createProduct($scope.newProduct())
.success(function(data){
$scope.selected_product = data["product"];
$scope.c... |
/* jshint node: true */
/* global require, module */
var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
var app = new EmberAddon();
// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object ... |
/* JavaScript Boilerplate helper file *
* @version 1.0
*/
/*jshint forin:true, noarg:true, eqeqeq:true, bitwise:true, undef:true, curly:true, browser:true, devel:true, indent:4, maxerr:50, jquery:true */
/*jslint devel: true, nomen: true, unparam: true, sloppy: true, indent: 4, newcap:true */
/*global FB:false, jQ... |
import { store } from '@risingstack/react-easy-state';
import * as api from './api';
// use 'appStore' instead of 'this' in the store methods to make them passable as callbacks
const appStore = store({
beers: [],
async fetchBeers(filter) {
appStore.isLoading = true;
appStore.beers = await api.fetchBeers(fi... |
define('NavigationBar', ['logging', 'jquery', 'jsb'], function(logging, $, jsb) {
"use strict";
var NavigationBar = function(domElement, options) {
var that = this;
this.domElement = $(domElement);
logging.applyLogging(this, 'NavigationBar');
that.writeQueryStringIntoFields();
that.domElemen... |
import React, { Component } from 'react';
// eslint-disable-next-line
import EntityModal from 'ringcentral-widgets/components/EntityModal';
import { Button } from 'ringcentral-widgets/components/Button';
const props = {};
props.currentLocale = 'en-US';
/**
* A example of `EntityModal`
*/
class EntityModalDemo exten... |
import { moduleFor, test } from 'ember-qunit';
moduleFor('route:todos', 'Unit | Route | todos', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
test('it exists', function(assert) {
var route = this.subject();
assert.ok(route);
});
|
import {expect} from 'chai';
import {SingletonFactory} from '../../src/singletons';
describe(`Testing README.md examples`, function () {
it('Function key(...args) example', function () {
class Class {
constructor () {}
};
const Singleton = SingletonFactory(
Class,
[
'object',
... |
var url = require('url'),
fs = require('fs');
// Client-side Javascript
var clientVersion = exports.version = '0.6.1';
var clientPath = '/socket.io-sessions.js';
var clientData = "\
io.connectWithSession = function(){\
var socket = io.connect.apply(io, arguments);\
socket.on('connect', function(){\
this.... |
import React, { Component } from 'react';
import { findDOMNode } from 'react-dom';
export default class extends Component {
constructor(props, context) {
super(props, context);
this.getDesc = this.getDesc.bind(this);
}
getDesc() {
let desc = findDOMNode(this.refs.desc).value;
... |
import React from 'react';
import styles from './styles.css';
function ListItem(props) {
return (
<li className={props.isTips ? styles.tipsItem : styles.item}>
<div className={styles.itemContent}>
{props.item}
</div>
<hr className={styles.divider} />
</li>
);
}
ListItem.propType... |
"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... |
//related to header_index.ui
var rootview = ui("$");
var nf = sm("do_Notification");
var page = sm("do_Page");
var app = sm("do_App");
var anim = require("anim");
//添加头部到当前UI
var headerTitle = rootview.add("titleHeader","source://view/header/header_title.ui",0,0);
var headerTitleStyle = ui("titleHeader");
var hdtype=3... |
var __reflect = (this && this.__reflect) || function (p, c, t) {
p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
};
var SoundManager = (function () {
function SoundManager() {
this.soundDic = {};
}
SoundManager.getInstance = function () {
... |
import find from 'lodash/find';
// temp data source until db and api is set up
const memberData = require('./data/members/members.json');
export const memberService = {
fetchMembers: () => memberData,
fetchMember: (memberId) => find(memberData, ['id', memberId])
};
const gigData = require('./data/gigs/gigs.json'... |
(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{271:function(t,e,n){"use strict";n.r(e);var s=n(0),i=Object(s.a)({},(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"theme-container"},[e("h1",[this._v(this._s(this.$page.frontmatter.title))]),this._v(" "),e("Content")],1)}),... |
'use strict';
const Reporter = require('./lib/reporter');
const DependencyChecker = require('./lib/dependency-checker');
module.exports = {
name: 'ember-cli-dependency-checker',
init: function() {
this._super.init && this._super.init.apply(this, arguments);
const reporter = new Reporter();
const depe... |
/*
* Copyright (c) André Bargull
* Alle Rechte vorbehalten / All Rights Reserved. Use is subject to license terms.
*
* <https://github.com/anba/es6draft>
*/
const {
assertSame, assertNotSame
} = Assert;
// Ensure tailcall removes intermediate caller from stack
{
function returnCaller() {
return returnCal... |
// Rollup plugins.
import buble from 'rollup-plugin-buble'
import cjs from 'rollup-plugin-commonjs'
import globals from 'rollup-plugin-node-globals'
import replace from 'rollup-plugin-replace'
import resolve from 'rollup-plugin-node-resolve'
export default {
dest: 'build/app.js',
entry: 'src/index.js',
format: '... |
/**
* @author Bluekiss
*/
'use strict';
var bluekiss=angular.module('bluekiss',['ngRoute','controllers']);
bluekiss.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/home', {
templateUrl: 'views/home.html',
controller: 'HomeCtrl'
}).
/*
when('/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.