text stringlengths 7 3.69M |
|---|
/**
* Created by jzj on 16/1/30.
*/
var TWColor = function(r,g,b,a){
var color = {
r: r,
g: g,
b: b,
a: a
};
color.__proto__ = TWColorFunc;
return color;
};
var TWColorFunc = {
toStyle: function(){
var s = 'rgba('+this.r+','+this.g+','+this.b+','+this.a+')... |
(function() {
'use strict';
function sendPostRequest(event) {
event.preventDefault();
var self = this;
$.post($(this).attr('href'), function(data) {
/* data = {
* votes: int,
* action: string [upvote|downvote|unvote]
* }
... |
import React, {Component} from 'react'
// import {connect} from 'react-redux';
import {View, Text, Image, TouchableHighlight, TouchableOpacity} from 'react-native';
// import ProfUserImg from './ProfUserImg'
import styles from './styles'
class NetworkDetail extends Component{
render(){
const { params } = this.p... |
//Set text filter
export const setTextFilter=(text="")=>({
type:'SET_TEXT',
text
});
//Set Start Date
export const setStartDate=(startDate)=>({
type:'SET_START_DATE',
startDate
})
//Set End Date
export const setEndDate=(endDate)=>({
type:'SET_END_DATE',
endDate
})
//SetSortByDate
export con... |
$(function () {
/*--- global animations init ---*/
/*---------------------------------------------------------------------*/
$(window).on('load', function() {
Animation.initGlobalAnimations({
container: '.out',
selfTriggeredElems: {
el1: {
selector: '.header',
triggerHook: 1,
class: 'is_a... |
/*
Program Table Definition
Input: getting name
Processing: adding the name to the scripture
Output: show the result of the concatenation
*/
function scripture(){
let name = document.getElementById("name").value;
let scripture1 = "I, ";
let scripture2 = ", having been born of goodly parents, therefore I was taug... |
export default function Select({ label, name, value, onChange, options }) {
return (
<>
<div className="root">
{label && <label htmlFor={name}>{label}</label>}
<select name={name} value={value} onChange={onChange}>
{options.map((option) => (
<option value={option.id} k... |
import React ,{ Component } from 'react';
import {View , Text, StyleSheet,Dimensions, Platform, Image } from 'react-native';
import { Constants, Permissions, Notifications, FacebookAds } from 'expo';
import { connect } from 'react-redux';
import * as actions from '../actions';
import PercentageCircle from 'react-native... |
const express = require("express");
const visitObj = require("../module-controllers/visit");
const doctorObj = require("../module-controllers/doctor");
const patientObj = require("../module-controllers/patient");
const nurseObj = require("../module-controllers/nurse");
const appointmentObj = require("../module-controll... |
const staticCacheName = ['restaurant-static-v80'];
const pageUrls = [
'/',
'/index.html',
'/restaurant.html'
];
const scriptUrls = [
'/js/dbhelper.js',
'/js/main.js',
'/js/restaurant_info.js',
'/js/Dialog.js',
'/js/swhelper.js'
];
const dataUrls = ['./data/restaurants.json'];
const sty... |
//requiring todolist model
const TodoLists = require("../models/TodoLists");
//home controller to render home page with form and list on it
module.exports.home = function (req, res) {
TodoLists.find({}, function (err, logs) {
if (err) {
console.log("Error in fetching contacts from the user");
return;
... |
const CucumberReportLogger = require('../../../codeceptCommon/reportLogger');
var { defineSupportCode } = require('cucumber');
const jsonpath = require('jsonpath');
const BrowserWaits = require('../../../e2e/support/customWaits');
// const MockApp = require('../../../nodeMock/app');
const CCDCaseConfig = require('.... |
let patientName = 'Rahim Chacha';
// patientName = 'Fatema Khala';
console.log(patientName);
let sum = 0;
for(var i = 0; i < 10; i++){
sum = sum + i;
}
console.log(i); |
var AuthmanFactory = artifacts.require("./AuthmanFactory.sol");
var AuthmanService = artifacts.require("./AuthmanService.sol");
var zeroAddress = '0x0000000000000000000000000000000000000000';
contract('AuthmanFactory', function(accounts) {
var factory;
var serviceAddress;
var dataAddress;
var account_one = a... |
class Item {
build(socket) {
socket.player.stone -= this.costs.stone;
socket.player.wood -= this.costs.wood;
socket.player.food -= this.costs.food;
socket.player.buildCode = this.id;
}
constructor(id, use, buildable) {
this.id = id;
this.use = use;
this.costs = {
stone: 0,
wood: 0,
food: 0
}... |
import styled from "@emotion/styled";
import React, { useMemo, useCallback } from "react";
const InputGroup = styled.div`
label {
margin-right: 1rem;
}
input {
width: 4em;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
select {
border-top-left-radius: 0;
border-bottom-le... |
$(function(){
var ID = $('.topbar-info .ID');
if(!!sessionStorage.getItem('ID')){
var txt =sessionStorage.getItem('ID')
ID.text(`欢迎:${txt}`);
ID.href ="javascript:disabled";
}else{
ID.text('登录');
ID.href = "./login.html";
}
}) |
const test = require('tape');
const arrayToHtmlList = require('./arrayToHtmlList.js');
test('Testing arrayToHtmlList', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof arrayToHtmlList === 'function', 'arrayToHtmlList is a Function'... |
import './App.css';
import React from 'react';
import Hello from './components/Hello'
class App extends React.Component {
constructor(){
super()
this.state = {
// color: 'red',
// show: true,
func:''
}
console.log('1')
}
componentDidMount(){
// console.log('2')
// setTimeout((... |
'use strict';
export default {
USER_EXISTS: [10001, '用户已存在'],
USER_NOT_EXISTS: [10002, '用户不存在'],
PASSWORD_INVALID: [10003, '密码错误'],
UPLOAD_ERR_TYPE: [20001, '上传文件类型错误'],
LACK_APP_ID: [20002, '缺少app_id'],
APP_NOT_EXIST: [20003, 'app_id对应的app不存在'],
UPLOAD_EMPTY_FILE: [20004, '上传文件为空'],
APP_NAME_NOT_EMPTY: [30001... |
import * as Users from "resources/users"
import calculatePanePosition from "helpers/calculate-pane-position"
import uniqueID from "helpers/unique-id"
export function createPane(tree, data) {
const panesCreated = tree.get("panesCreated")
const panesCursor = tree.select("panes")
const attributes = Object.assign({
... |
import React from 'react'
import BuildsData from 'components/builds/BuildsData'
import BuildProfil from 'components-lib/buildProfil/BuildProfil'
import BuildsList from 'components-lib/buildsList/BuildsList'
import BuildInfos from 'components-lib/buildInfos/BuildInfos'
import './Builds.scss';
/* This class was auto-ge... |
const styles = require('../styles')
//Documentation for Phaser's (2.6.2) text:: phaser.io/docs/2.6.2/Phaser.Text.html
class ChartLabel extends Phaser.Text {
//initialization code in the constructor
constructor(game, x, y, text) {
super(game, x, y, text, styles.fonts.medium(game));
this.anchor.set(0.5, 0.5... |
const fs = require('fs');
const minimist = require('minimist');
const path = require('path');
const spawn = require('cross-spawn');
const copyTemplateFiles = require('./inc/copy-template-files');
const extract = require('./inc/extract');
const updatePakageScripts = require('./inc/update-package-scripts');
const appDi... |
const cp = process.cwd() + "/Controllers/";
const provinces = require(cp + "support/ProvincesController");
module.exports = function(fastify, opts, next) {
fastify.get('/provinces', {
preValidation: [fastify.auth]
}, provinces.index)
fastify.patch('/provinces/update', {
preValidation: [fas... |
Join = {
web3Provider: null,
contracts: {},
init: async function() {
await Init.init();
Join.getAccountInfo();
},
getAccountInfo: function() {
web3.eth.getAccounts(function(error,accounts){
Join.makeSelect(accounts);
return Join.bindEvents();
});
},
makeSe... |
import { gql } from 'apollo-server-micro';
export default gql`
type Mutation {
login(accessToken: String!): String!
saveLetter(
email: String!
message: String!
anonymous: Boolean!
templateId: ObjectId!
): Letter
sendThankYouM... |
"use strict";
var twitterIcon = document.querySelector('.twiiter_icon');
var content = document.querySelector('.main_content_body');
var navButton = document.querySelector('.navButton');
var sideDrawerBtn = document.querySelector('.side_drawer_button');
twitterIcon.addEventListener("click", function () {
document.ge... |
var util = require("util");
function Base() {
this.name = "base";
this.base = 1991;
this.say = function() {
console.log("Hello "+this.name);
};
}
Base.prototype.showName = function(){
console.log(this.name);
};
function Sub() {
this.name = "sub";
}
/*
* 注意:Sub 仅仅继承了Base 在原型中定义的函数,
* 而构造函数内部创造的 base 属 性和 s... |
// $(document).on("change", '#filter-form input[type="radio"]', function() {
// var create_report_form_input = $('#create-monthly-report-form').find('#' + $(this).attr('id'));
// create_report_form_input.prop('checked', true);
// });
//
//
// $(document).on("change", '#filter-form select', function() {
// v... |
import '../stylesheets/javascript30.scss';
const controllers = document.querySelectorAll('.controller');
function handleValueUpdate() {
const suffix = this.dataset.sizing || '';
document.documentElement.style.setProperty(`--${this.name}`, `${this.value}${suffix}` );
}
controllers.forEach(
controller => control... |
$('[data-toggle="popover"]').popover();
$('body').on('click', function (e) {
$('[data-toggle="popover"]').each(function () {
if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {
$(this).popover('hide');
}
});
});
let rangeSl... |
//======================================================
// 出品するボタンを押したとき、銀行情報があるかいかを確認する
//======================================================
$(document).on('click', '#js-bank_confirm', function (e) {
e.preventDefault();
const msg = this.id === 'js-bank_confirm'
? '出品するためには、売上金の振込先である銀行情報等を登録していただ... |
import React from 'react';
import { useQuery } from '@apollo/client';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Control from 'react-leaflet-control';
import { tablesEditingStatus as setEditingStatus } from '../../apollo/cache';
import { GET_EDITING_STATUS } from './requests';
im... |
import React, { Component } from 'react';
import {
StyleSheet,
View,
Text,
StatusBar,
TouchableOpacity,
Dimensions
} from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
import AsyncStorage from '@react-native-community/async-storage';
import firebase from 'react-native-firebase';... |
/**
* @namespace
*/
vonline.Dialog = function(options) {
this.options = this.getOptions(options);
this.background = $('<div/>').addClass('dialog_background').appendTo('body');
this.container = $('<div/>').addClass('dialog_container').appendTo(this.background);
this.content = $('<div/>').html(this.options.text).ap... |
function objKeyCheck(keyToCheck, obj) {
return keyToCheck in obj;
}
module.exports = objKeyCheck;
|
const data = {
'2020-08-01': false,
'2020-08-02': false,
'2020-08-03': false,
'2020-08-04': false,
'2020-08-05': false,
'2020-08-06': false,
'2020-08-07': false,
'2020-08-08': false,
'2020-08-09': false,
'2020-08-10': false,
'2020-08-11': false,
'2020-08-12': false,
'2020-08-13': false,
'202... |
import React, { Component } from "react";
import Logo from './Thomas Krief Art Logo Noir.png';
class Header extends Component {
state = {
show: false
}
toggleMenu = () => {
const doesShow = this.state.show;
this.setState({ show: !doesShow })
}
render() {
return (
<div className="site-... |
// Definindo variáveis
const nome = "Silvana";
const sexo = "F";
const idade = 48;
const contribuicao = 23;
// Calculo para a regra 85-95
const aux = idade + contribuicao;
if ((sexo === 'M' && contribuicao >= 35) || (sexo === 'F' && contribuicao >= 30)) {
// Se o usuário tiver acima da tempo mínimo de contribuição... |
var confige = require("confige");
cc.Class({
extends: cc.Component,
properties: {
},
onLoad: function () {
console.log("onInit!!!!!!!!!!!!!!!!!!!!!!!");
},
onInit:function(){
confige.loadNode = this;
cc.game.addPersistRootNode(this.node);
... |
function ProfilePicture(props) {
// console.log(props.currentPicture)
// onMouseOver not working yet :/
return(
<div>
<div>Profile Picture</div>
<select defaultValue={props.currentPicture} onChange={props.onSelectProfilePicture}>
<option value='0' onMouseOver=... |
import React, { useEffect } from 'react'
import Article from './Article/Article'
import { Grid, Typography } from '@material-ui/core'
import config from '../../api-config/config.json'
import useFetchAll from '../../services/useFetchAll'
import Spinner from '../UI/Spinner/Spinner'
export default function ArticleList() ... |
import React from 'react';
import { rhythm } from '../utils/typography';
class Footer extends React.Component {
render() {
return (
<footer
style={{
marginTop: rhythm(2.5),
paddingTop: rhythm(1),
}}
>
© {new Date().getFullYear()}
... |
// @ts-check
import axios from 'axios';
import React from 'react';
import update from 'immutability-helper';
import Item from './Item.jsx';
import routes from './routes.js';
// BEGIN (write your solution here)
const compare = ( a, b ) => {
if ( a.id > b.id ){
return -1;
}
if ( a.id <... |
// @flow
class Status {
// Getting access to status codes constants
static SUCCESS = 200;
static CREATED = 201;
static CONFLICT = 409;
static INVALID = 400;
static NOT_AUTHORIZED = 401;
static FORBIDDEN = 403;
static NOT_FOUND = 404;
/**
* Check if the api status code is 200 or 201
* @pa... |
const { Schema, model } = require("mongoose");
let RequestSchema = new Schema({
requested: {
type: Schema.Types.ObjectId, ref: 'user'
},
searcher: {
type: Schema.Types.ObjectId, ref: 'user'
},
status: {
type: String,
default: 'pending'
},
request_date: Date,
message: String,
requ... |
'use strict';
import * as chai from 'chai';
const chaiAsPromised = require('chai-as-promised');
const chaiThings = require('chai-things');
const expect = chai.expect;
import * as sinon from 'sinon';
import * as sinonAsPromised from 'sinon-as-promised';
const sinonChai = require('sinon-chai');
const awsMock = require('... |
/*TODO 对象模板(构造函数)
function Storage(){
this.length = 10;
this.setItem = function(){}
}*/
/*TODO 创建 Storage 的两个对象
window.sessionStorage = new Storage();
window.localStorage = new Storage();
*/ |
export default function useTemplate() {
return 'You are using the default template.'
}
|
"use strict";
var Item = require('../models/models').Item;
var _ = require('lodash');
var items = {
crear: function(req, res) {
var nuevoItem = {
_id : req.body._id,
descripcion : req.body.descripcion,
costo : req.body.costo,
precioMin : req.body.precioMin,
precioMa... |
'use strict';
const FileChecker = require('./file-checker');
const SpellChecker = require('./index');
const path = require('path');
const pathToDict = path.resolve(path.join(__dirname, './dictionaries'));
class FakeReporter {
constructor() {
this.entries = [];
}
push(entry) {
console.log(entry);
th... |
const apiKey = '1adbf2cc';
const getRate = async (id) => {
const url = `https://www.omdbapi.com/?i=${id}&apikey=${apiKey}`;
const res = await window.fetch(url);
if (!res.ok) throw new Error(res.status);
const data = await res.json();
return data.imdbRating;
};
const getSearchResults = async (sea... |
/**
* LINKURIOUS CONFIDENTIAL
* Copyright Linkurious SAS 2012 - 2018
*
* - Created on 2015-06-29.
*/
'use strict';
/**
* A generic parser to cleanly remove/retrieve string literals from strings, while respecting escaping.
*
* @param {string[]} delimiters the string literal delimiters (e.g. [', "]
* @param {st... |
var btnRegister = document.forms['register-form']['btn-register'];
btnRegister.onclick = function()
{
var firstName = document.forms['register-form']['firstName'].value;
var lastName = document.forms['register-form']['lastName'].value;
var password = document.forms['register-form']['password'].value;
v... |
import requestCreator from 'core/helpers/request';
import { AuthStore } from 'src/modules/auth';
import userModule from 'src/modules/user';
import Common from '../stores/common';
import Ui from '../stores/ui';
// All our actions are listed here
export const storesCreator = (state = {}, accessToken) => {
function get... |
var app = angular.module('plunker', ['chart.js']);
app.controller('MainController', function($scope, $http) {
var canvas=document.getElementById("canvas");
var ctx=canvas.getContext("2d");
var cw=canvas.width;
var ch=canvas.height;
var line = document.getElementById("line");
var ctx1 = line.getContext(... |
var _viewer = this;
/*
* 删除前方法执行
*/
rh.vi.listView.prototype.beforeDelete = function(pkArray) {
showVerify(pkArray,_viewer);
};
|
import * as sectionApi from '@/module/project-manage/api/section'
import * as sysApi from '@/base/api/user'
const state = {
allSections: [],
sections: [],
total:0,
// 标段详情数据
list:{
id: {
value: '',
label: 'id',
hidden: true
},
delFlag: {
value: '',
label: '其他标段',
... |
var maze;
function setup() {
createCanvas(CELLS_ACROSS * CELL_SIZE + STROKE_WEIGHT, CELLS_DOWN * CELL_SIZE + STROKE_WEIGHT);
maze = new Maze(CELLS_ACROSS, CELLS_DOWN);
rectMode(CORNERS);
strokeWeight(STROKE_WEIGHT);
}
function draw() {
maze.step();
background(128);
maze.draw();
}
|
document.addEventListener('init', function (event) {
var page = event.target;
if (page.id === 'BasketPage') {
} else if (page.id === 'OrderPage') {
backBasket();
}
});
const getBasketForUser = (user) => {
$("#showBasket").empty();
var countItem = 0;
db.collection("Pets").get().th... |
import request from "superagent";
import { baseUrl } from "./ads";
export const LOGIN_SUCCESS = "LOGIN_SUCCESS";
const loginSuccess = jwt => {
return {
type: LOGIN_SUCCESS,
jwt
};
};
export const login = data => dispatch => {
request
.post(`${baseUrl}/logins`)
.send(data)
.then(res => dispa... |
'use strict';
const express = require('express');
const router = express.Router();
let userController = require('../controllers/userController');
let commentController = require('../controllers/commentController');
let headerController = require('../controllers/headerController');
// API PRIVATE
router.use('/api/v1/... |
/* global define */
/**
* @description Util fn for use with Crockford's functional inheritance structure (i.e. drivers)
* Creates object with reference to all the original super fny, that can be used by the extending class.
*
* @usage implement immediately after extending super object:
* var that = basic... |
/**
* Created by eamonnmaguire on 08/07/2016.
*/
var citation_summary = (function () {
var self_cite_colors = d3.scale.ordinal().domain(["self", "not self"]).range(["#e74c3c", "#3498db"]);
var subject_area_colors = d3.scale.ordinal().range(["#95a5a6", "#7f8c8d", "#34495e", "#8e44ad"]);
var citation_type... |
import React from 'react';
import Component from './componentes/Componente';
import getContentComponents from './assets/getContentComponent';
import './global.css';
export default function App() {
const data = getContentComponents();
return (
<div className="container_components">
{
... |
'use strict';
// Imports
const chai = require('chai');
const expect = chai.expect;
const jsdom = require('jsdom').jsdom;
const _$ = require('jquery');
const chaiJquery = require('chai-jquery');
// Setup document
const documentHTML = '<!doctype html><html>' +
'<body><input id="longitude"><input id="latitude"><button i... |
import React from 'react'
import Img from 'gatsby-image'
import { Link } from 'gatsby'
import { makeStyles } from '@material-ui/core/styles'
import Container from '@material-ui/core/Container'
import Card from '@material-ui/core/Card'
import CardActions from '@material-ui/cor... |
var path = require('path'),
webpack = require('webpack'),
libPath = path.join(__dirname, 'lib'),
distPath = path.join(__dirname, 'dist'),
HtmlWebpackPlugin = require('html-webpack-plugin'),
ImageminPlugin = require('imagemin-webpack-plugin').default,
OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin... |
var DiContainer = require('../DiContainer');
describe('Dicontainer', () => {
var container;
beforeEach(() => {
container = new DiContainer();
});
describe('register(name, dependencies, func)', () => {
it('인자가 하나라도 빠졌거나 ㅏ입이 잘못되면 예외를 던진다.', () => {
var badArgs = [
... |
const config = {
apiKey: 'YOUR_API_KEY',
authDomain: 'YOUR_AUTH_DOMAIN.firebaseapp.com',
databaseURL: 'https://YOUR_AUTH_DOMAIN.firebaseio.com',
projectId: 'YOUR_AUTH_DOMAIN',
storageBucket: 'YOUR_AUTH_DOMAIN.appspot.com',
messagingSenderId: 'YOUR_MESSAGING_SENDER_ID'
};
export default config;
|
google.charts.load("current", { packages: ["bar"] });
google.charts.setOnLoadCallback(drawBarChart2);
function drawBarChart2() {
const arrayLength = monthly_spendings.length;
let content = [["Commission", "amount of commission"]];
for (var i = 0; i < arrayLength; i++) {
content.push([months[i], monthly_spend... |
const express = require('express');
const routes = express.Router();
const usuario = require('../controllers/usuario');
const ferramenta = require('../controllers/ferramenta');
const alugueis = require('../controllers/alugueis');
/*Rotas de usuário*/
routes.post('/usuario', usuario.create);
routes.get('/usuario', us... |
// #7 Class
// Create a Str class with methods to:
// Add lower method to convert a string to lower case.
// Str.lower('MAKAN') // makan
// Add upper method to convert a string to upper case.
// Str.upper('malam') // MALAM
// Add capitalize method to capitalize all first letter of words.
// Str.capital... |
import {trackingTransitionBlock} from './init-animations';
const scrollContainer = document.querySelector('.scroll-container');
const scrollTranslator = document.querySelector('.scroll-translator');
const scroller = document.querySelector('.scroller');
const horizontalScrollBlock = document.querySelector('.horizontal-... |
import styled from 'styled-components';
export const Wrapper = styled.div`
max-width: ${({ theme }) => theme.constants.maxWidth};
padding: 0 1.6rem;
margin-bottom: ${({ extraHeadingMargin }) =>
extraHeadingMargin ? '4.8rem' : '2.4rem'};
width: 100%;
@media ${({ theme }) => theme.mediaQueries.tablet} {
... |
import React, { useState } from 'react';
import * as THREE from 'three';
export const useSceneData = () => {
const [controls, setControls] = useState(null);
const setupScene = (mount) => {
const sizes = {
width: window.innerWidth,
height: window.innerHeight,
}... |
import React from 'react'
import HomeBody from '../../components/HomeBody/HomeBody'
export default function AdminHome() {
return (
<div>
<HomeBody/>
</div>
)
}
|
import parseArgs from './config/args';
export async function cli(args) {
const cl = parseArgs(args);
let cmd = cl.command[1];
if(cl.options.version) {
cmd = 'version';
}
if(cl.options.help || !cmd) {
cmd = 'help';
}
// actions loaded w/ dynamic imports to improve cli perf... |
import React, { useState, useReducer } from 'react'
import { initialState, todoReducer } from '../reducers/reducer'
const TodoForm = () => {
const[newTodo, setNewTodo] = useState()
const[state, dispatch] = useReducer(todoReducer, initialState)
const handleSubmit = e => {
e.preventDefault()
... |
// server.js
// where your node app starts
// init project
const express = require('express');
const app = express();
// we've started you off with Express,
// but feel free to use whatever libs or frameworks you'd like through `package.json`.
// http://expressjs.com/en/starter/static-files.html
app.use(express.sta... |
/------------------------------ ตั้งค่า firebase ------------------------------/
const db = firebase.firestore();//สร้าตัวแปร object สำหรับอ้างอิง firestore
function myFunction() {
var username = document.getElementById("start").value;
var element = document.getElementById("chart");
if(element != nul... |
"use strict";
var vert_code=`#version 300 es
in vec2 a_position;
in vec2 a_texCoords;
uniform vec2 res;
out vec2 texCoords;
void main()
{
//convert the pixel locations to (0.0 to 1.0) form
vec2 zeroOne=a_position/res;
//convert them to (0.0 to 2.0) form
vec2 zeroTwo=zeroOne*2.0;
//convert them... |
var Canvas2dRenderingSystem = System.extend('Canvas2dRenderingSystem',
function Canvas2dRenderingSystem(ctx) {
System.call(this);
this.ctx = ctx;
},
{
aspects: {
cameras: Aspect.all(['Camera2d', 'Transform2d']),
objects: Aspect.all(['SimpleGraphics', 'Transform2d'])
... |
$(document).ready(function(){
///// JEQUERY GOES HERE
});
|
X.define("modules.commodityManage.commodityManageList", ["modules.common.routerHelper", "model.commodityManageModel", "data.currencyEntireData", "common.commonMethod"],
function (routerHelper, commodityManageModel, currencyEntireData, commonMethod) {
//初始化视图对象
var view = X.view.newOne({
el: $(".xbn... |
'use strict'
const mongoose = require('mongoose');
const co = require('co');
const parallel = require('co-parallel');
const moment = require('moment');
const config = require('../config');
const Simcard = require('../app/models/simcard');
const DataPackage = require('../app/models/dataPackage');
const PurchaseHistory... |
import React from 'react';
const makeProps = (props)=> {
const nprops = Object.assign({}, props);
delete nprops.children;
return nprops;
};
const makeChildren = (children)=> {
if (Array.isArray(children)) {
return children;
}
return [children];
};
const areElementsEq = (actual, expected, eq, testers)... |
class Annotate {
constructor (element, opts) {
this.element = element
this.options = {
prompt: {
width: 200,
height: 50,
text: 'Adding notes',
className: 'annotation-prompt'
},
content: {
className: 'annotation-content'
}
}
if (typeof ... |
$(document).ready( () => {
const modal = $("#modal-box")[0];
const formEdit = $("#editForm");
$(document).on("click", ".edit-btn", () => {
modal.style.display = "block";
// Get data-id of edit-button and assign it to edit-form
let studentId = $(event.target).attr('data-id');
formEdit.attr(... |
/*(function () {*/
'use strict';
dmtApplication.factory("invoiceService", invoiceService);
function invoiceService($http, __env, $window) {
var service = {
getAllInVoices : getAllInVoices,
getAllInvoiceType : getAllInvoiceType,
create : create,
update : update,
deleteRow : deleteRow
... |
alert("olá mundo");
console.log(document.querySelector(".titulo_principal"));
var titulo = document.querySelector(".titulo_principal");
titulo.textContent = "Avaliação Fisica Senai";
console.log(titulo.textContent);
var paciente = document.querySelectorAll(".paciente");
for(var i=0;i<paciente.length;i++){
var t... |
import "./App.css";
import { useState } from "react";
function Header(props) {
return (
<header>
<p>
Hello {props.name}
</p>
<button onClick={props.click}>Trocar usuário</button>
{props.children}
<hr />
</header>
)
}
function Form() {
const [nome, setNome] = useState... |
const express = require('express');
const bodyParser = require('body-parser');
const PORT = process.env.PORT || 3000;
const app = express();
// body parser
app.use(bodyParser.urlencoded({
extended: false
}));
app.use(bodyParser.json());
// set header
app.use(function(req, res, next) {
res.setHeader('charset'... |
// include a script programmatically, by appending it
// to the head of the page. guards against re-insertion,
// and returns 'loaded' when successful.
function liveRequire(x, callback) {
var scripts = document.head.getElementsByTagName('script');
for (var i = 0; i < scripts.length; i++) {
if (scripts[i... |
#!/usr/bin/env node
require("../dist/backup");
|
import React, {useState, useEffect} from "react";
import { useDispatch} from "react-redux";
import { validateTokenAPICreator } from "../redux/actions/auth";
import Header from "../components/Header";
import Navbar from "../components/Navbar";
import Main from "../components/Main";
import Aside from "../components/Aside... |
import isPlainObject from 'lodash/lang/isPlainObject';
export default function meldPartialState(handler, initialState, previousState) {
let stateOut = previousState;
// @todo support for Maps!
if (isPlainObject(initialState)) {
const isComplete = isEquivStructure(initialState, previousState);
if (!isCom... |
import React from 'react';
import {Form, Message} from 'semantic-ui-react';
import LoadingButton from './common/LoadingButton';
const ReplyForm = (props) => {
const {onSubmit, status, content} = props;
return (
<Form reply onSubmit={onSubmit}>
<Form.TextArea id='comment__reply'/>
... |
const { SERVER_ERROR } = require('../configs/constants');
const CentralizedErrorHandler = ((err, req, res, next) => {
// если у ошибки нет статуса, выставляем 500
const { statusCode = 500, message } = err;
// проверяем статус и выставляем сообщение в зависимости от него
res.status(statusCode).send({ message: ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.