text
stringlengths
7
3.69M
import React from 'react'; function Card(props){ function renderDetail(){ props.detail(props.id); } return( <center> <div className="container mt-4 detailCard col-10" align="left" onClick={renderDetail} style={{fontFamily:"Arial"}}> ...
export const checkTimerGet = (rootName, nomeTimer) => { const timer = window.sessionStorage.getItem('timerGetData') ? JSON.parse(window.sessionStorage.getItem('timerGetData')) : {} if (!timer[rootName]) { return true } if (timer[rootName][nomeTimer]) { return timer[rootName][nomeTimer] <= Date...
/** * Routers */ define([ 'jquery', 'underscore', 'backbone', 'models', 'collections', 'views' ], function($, _, Backbone, models, collections, views) { var routers = {}; routers.DashboardRouter = Backbone.Router.extend({ initialize: function(options) { this.options = options; this.app = option...
const button = document.querySelector('button') let input = document.querySelector("input") let showing = document.querySelector("p") let finalInput; button.addEventListener("click", () => { finalInput = parseInt(input.value) timer(finalInput) }) function timer(number) { if (number < 0) { return 0...
import React, { Component } from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import PropTypes from 'prop-types'; import { Button } from 'reactstrap'; import styles from './bookingConfirmation.scss'; import { imagePath } from '../../utils/assetUtils'; import * as actions f...
// INITILIZE APP // ============================================================ var app = angular.module("app", ['ui.router']); // CONFIG // ============================================================ angular.module("app").config(function($stateProvider, $urlRouterProvider) { // INITILIZE STATES // ============...
/** * Created by sumrazafar on 9/20/15. */ 'use strict'; angular.module('services.feedback.main', []) .service('mainFBsrv', ['$http', '$rootScope', '$q', 'Constants', function ($http, $rootScope, $q, Constants) { //POST feedback to Db this.PostFeedback = function (mod...
import { Mongo } from 'meteor/mongo'; export const Events = new Mongo.Collection( 'events' ); /*Events.allow({ insert: () => false, update: () => false, remove: () => false }); Events.deny({ insert: () => true, update: () => true, remove: () => true }); let EventsSchema = new SimpleSchema({ 'text': { ...
(function(factory){ if (typeof define === 'function' && define.amd) { define(['jquery'], factory); } else { factory(window.jQuery); } })(function($){ $.fn.defaultConfig = { layoutSytle : "default-layout", backgroundStyle : "default-background", contentStyle : "default-conte...
import React from "react"; import { useSelector, useDispatch } from "react-redux"; import { setCity, setCoordinates, setData } from "../redux/actions/index"; import * as api from "../utils/api"; function Searching() { const dispatch = useDispatch(); const state = useSelector((state) => state); function handle...
import autobind from 'autobind-decorator'; import ServerDetails from "./components/serverDetails"; import Shell from "./components/shell"; export default class Root extends React.Component { @autobind hasServerInfo(){ console.log( localStorage.serverPort, localStorage.serverAddress, localStorage.serverKe...
'use strict'; var encode = require('./../encode.js').encode; exports.init = function(plugins, server){ plugins.listen(this, 'ping', function(args){ var doc = args.doc; var data = args.data; var msg = []; var code = 'ID 1337\n'; //message.push('MU /mood/1.mp3'); code += 'MU http://translate.google.com/tran...
import moment from 'moment' import Vue from 'vue' Vue.filter('timeformat', (arg) => { return moment(arg).format('LL') }) Vue.filter('sortlength',(text,length,sufffix) =>{ return text.substring(0,length)+sufffix; })
import React, { Component } from 'react'; import './HomeView.css'; export default class HomeView extends Component { render() { let movie1 = this.props.movies[0]; let movie2 = this.props.movies[1]; let movie3 = this.props.movies[2]; return ( <div className="container"> ...
'use strict'; /* Controllers */ angular.module('eCommerce.controllers', []) .controller('ProductsCtrl', ['$scope', 'ajax', 'alert', function ($scope, ajax, alert) { $scope.products = []; ajax.all('products').getList().then(function (products) { $scope.products.items = products; ...
// modeling a deck of cards using javascript var faces = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, "Jack", "Queen", "King"]; var suits = ["Hearts", "Spades", "Clubs", "Diamonds"]; // what if we could interact with a single card by making it an object? // making a card constructor: function Card(face, suit) { this.face = f...
//Hack central var swear_words = require('./swear_words.js'); module.exports = function(responseBody, customizer){ var body = JSON.parse(responseBody); var results = {}; console.log('RESPONSE BODY ' + responseBody); if(!body.docs) { return []; } body.docs.forEach(function(doc) { if(doc.term_vect...
'use strict'; module.exports = { load () { // execute when package loaded console.log("load"); }, unload () { // execute when package unloaded console.log("unload"); }, messages: { 'openPanel' () { Editor.Panel.open('base'); }, 'exportUI'(){ Editor.Scene.callSceneScript('base', 'exportUI', ...
import React from "react"; import Star from "../Star/Star"; import * as styles from "./Rating.css"; const Rating = ({color, selected = 0, total = 5, onRate }) => ( <div className={styles.rating}> { [...Array(total)].map((n, i) => { return (<Star key={i} selec...
export HelloWorld from './components/HelloWorld';
/*(function() { 'use strict'; angular.module('myApp', []).controller('VideoListController', function($http, $log) { var ctrl = this; ctrl.query = 'Rick Astley'; ctrl.search = function() { return $http.get('https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=20&type=...
import { Pool } from 'pg'; import keys from '../config/keys.js'; let pool; if (process.env.NODE_ENV == 'production') { pool = new Pool({ connectionString: process.env.DATABASE_URL, ssl: { rejectUnauthorized: false, }, }); } else { pool = new Pool({ user: keys.PG_CONNECTION.USER...
/* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); y...
import DataType from 'sequelize'; import Model from '../../sequelize'; const UserLogin = Model.define('UserLogin', { id: { type: DataType.INTEGER(11), allowNull: false, primaryKey: true, autoIncrement: true, }, authToken: { type: DataType.STRING(100), }, }); export default UserLogin;
var BinarySearchTree = function(value) { var bstTree = {}; bstTree.value = value; bstTree.left = null; bstTree.right = null; bstTree.insert = function(value) { if (this.value > value) { //if true, we create a left child if (!this.left) { //If no current children var child = BinarySearchTree...
// vim: ft=javascript { function upjoin(arr) { return up(join(arr)); } function up(text) { return text.toUpperCase(); } function join(arr) { return _.flatten(arr).join("").trim(); } function splitOpcode(op) { return op.split(","); } function dRegisterShift(val) { return val <<...
import React from "react" import styled from "styled-components" import iconArrowRight from "../../images/icon-arrow-right.svg" const BreadCrumbC = (props) => ( <Wrapper className={props.className}> <MainWrap> {props.links.map((v, i) => ( <div key={i}> <MainText onClick={v.onClick}>{v...
const faker = require('faker'); const logger = require('../utils/logger'); // models const Certification = require('../models/Certification.model'); const User = require('../models/User.model'); const Coaching = require('../models/Coaching.model'); const totalUsers = 15; const practices = ['DEVELOPMENT', 'QE', 'R&D']...
export default function FooterComponent() { return <h3>This is Footer Component</h3> }
module.exports = { files: [ 'vendor/lodash/dist/lodash.js', 'vendor/jquery/dist/jquery.js', 'vendor/angular/angular.js', 'vendor/angular-bus/angular-bus.js', 'vendor/angular-mocks/angular-mocks.js', 'vendor/angular-ui-router/release/angular-ui-router.js' ] };
DrunkCupid.Views.Message = Backbone.View.extend({ template: JST['messagesMessage'], events: { 'click .msg-item': 'decrementRecents' }, initialize: function () { if (DrunkCupid.currentUser.get('channel') == undefined) { this.listenToOnce(DrunkCupid.currentUser, 'sync', this.bindChannel); } el...
const counts = { blue: 8, red: 8, black: 1, grey: 7, green: 0 } function shuffle(array) { let counter = array.length // While there are elements in the array while (counter > 0) { // Pick a random index const index = Math.floor(Math.random() * counter) // Decrease counter by 1 counter-...
QUnit.test( "Test VirtualDevice-object (js/classes/objects/VirtualDevice.js) ACTORS MODE1", function( assert ) { // Create instance of object which is testing var obj = new VirtualDevice(1) // First test instantiation assert.ok( obj instanceof VirtualDevice, "Instantiation" ); // Second test instantiati...
import React from "react"; import { FormControl, FormLabel, Input, Button, Center, Flex, Box, Select, Checkbox, Text, } from "@chakra-ui/react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faDollarSign, faPoundSign, faEuroSign, faCheck, faTimes, } from "@fort...
var util = require('util'); var xmlparts = require('./xmlparts'); var et = require('elementtree'); //console.log('exports= ' + util.inspect(xmlparts)); exports = module.exports = {}; // // rules array, each rule is a hash with: // name - only to have some resolutions between different rules // active - if active !=...
var commandsList = fs.readFileSync('C:\Users\kamju\ratbot\commands\commands.txt', 'utf8'); module.exports = { name: 'help', description: 'Heres what you can do', execute(message, args) { message.channel.send(commandsList); }, };
const index = require( '../dist/index' ); const { triggerUnhandledWarnings, splitLines, cutColumn, } = require( './helpers' ); describe( "logger", ( ) => { it( "setLogger", async ( ) => { const logger = jest.fn( ); index.setLogger( logger ); index.register( ); const err = new Error( "foobar" ); new ...
'use strict'; const assert = require('assert'); const nock = require('nock'); const LaMetricLocal = require('../lib/lametric-local'); const VERSION = require('../package.json').version; describe('LaMetricLocal', function() { describe('Constructor', function() { let defaults = {}; before(function() { ...
import React, { useContext } from "react"; import HistoryContext from "context/historyContext"; import "./ProductCard.scss"; /* * Reusable card component that receives two props * "item" is the element from the "database" that is being populated. * "cardType" defines if its a regular item or history item * * regu...
"use strict"; var _1 = require('../server/'); var LOGIN_ERR_MSG = "\n The username or password you have entered is invalid.\n"; function login(user) { return new Promise(function (resolve, reject) { return _1.post('/auth/login', user) .then(function (json) { return resolve(json.meta); }) ...
self.__precacheManifest = [ { "revision": "229c360febb4351a89df", "url": "/static/js/runtime~main.229c360f.js" }, { "revision": "ba7cd548a71c624cd2e8", "url": "/static/js/main.ba7cd548.chunk.js" }, { "revision": "eb7f6d2284de7f3051f0", "url": "/static/js/1.eb7f6d22.chunk.js" }, { ...
import React, { Component } from 'react'; import Helmet from 'react-helmet'; import { Well } from 'react-bootstrap'; export default class About extends Component { state = { }; render() { const styles = require('./About.scss'); return ( <div className={styles.about}> <div className="contai...
let asyncIterable={ [Symbol.asyncIterator](){ let i=0 return{ next(){ if(i<5){ return Promise.resolve({ value:i++, done:false }) }else{ return Promi...
// 晒单详情:某个商品某一期的晒单详情 var DM_ShareInfo = function(){ MessageMachine.call(this); // url this.url = url_host+"/comm/share/"; // template this._template= ' <div class="ub ub-fh" onclick="openUserspace({{tradeDetail.targetUser.id}})"> '+ ' <div class="ub-img1 img-head" style="background-image...
const envalid = require('envalid'); const { str, port } = envalid; const main = envalid.cleanEnv(process.env, { INSTAGRAM_USER_NAME: str(), INSTAGRAM_PASSWORD: str() }) module.exports = main;
$(function() { $("#head_rl").addClass('active_leftNav'); $("#company").bind("blur",function(){ // 1 验证是否输入 var company = $("#company").val(); if(company==null || company=="" || company == $("#company").attr("placeholder")){ $("#company").attr("data-content","请输入"); $("#com...
var PictureViewer = React.createClass({ rightArrow: function () { return ( <div onClick={this.handleRight} style={{position: "absolute", top: "0", right: "0", background: "white"}}> <span className={"glyphicon glyphicon-chevron-right"}></span> </div> ) }, handleRight: f...
/* eslint-disable strict, no-unused-vars */ const foo = (bar)=> { return bar + 1; }; const baz = (quux) =>{ return quux + 1; }; const fn = (arg) => { return arg + 1; };
const mongoose = require('mongoose'); const Schema = mongoose.Schema; const preferencesSchema = new Schema({ buyerID: String, neighborhood_preferences: Schema.Types.ObjectId, property_preferences: Schema.Types.ObjectId, }); module.exports = mongoose.model('Preference', preferencesSchema);
import React from 'react'; import RecipeIngredients from './RecipeIngredients/RecipeIngredients'; import RecipeTitle from './RecipeTitle/RecipeTitle'; import RecipeInstructions from './RecipeInstructions/RecipeInstructions'; const Recipe = props => ( <div> <RecipeTitle title={props.title} img={prop...
const notificationTypes = Object.freeze({ SHOW_NOTIFICATION: 'SHOW_NOTIFICATION', CLOSE_NOTIFICATION: 'CLOSE_NOTIFICATION' }); export default notificationTypes;
Ext.define('ISS.view.main.Main', { extend: 'Ext.tab.Panel', xtype: 'main', requires: ['ISS.view.Map', 'ISS.view.main.MainController', 'ISS.view.main.MainModel'], controller: 'main-main', // Create the controller instance viewModel: 'main-main', // Create the view model instance tabBarPosition:...
'use strict'; ///////////////////////////solution template////////////////////////////// const fs = require('fs'); const path = require('path'); const online_judge = !fs.existsSync(path.resolve(__dirname, 'input.txt')); let __buffer = ""; let __pos = 0; let __wstream; const print = s => __wstream.write(s....
$(document).ready(function(){ $('.logo-big').click( function() { var toggleWidth = $(".header").width() == 114 ? "100%" : "114"; $('.header').animate({ width: toggleWidth }); $(".buttons").animate( { height: 0 }) $(".buttons").toggle(); $(".logo-second").toggle(); }); ...
import React, { Component } from "react"; import AddWishlistItem from "./AddWishlistItem"; import WishlistItem from "./WishlistItem"; import { getWishlistItems, toggleUiPanel } from "../../../actions"; import { connect } from "react-redux"; const INITIAL_STATE = { error: null }; class WishlistPanel extends Compon...
const request = require('supertest'); const app = require('../../server/app'); describe('GET /', () => { test('It should return a 200 status', async (done) => { const res = await request(app).get('/'); expect(res).toHaveProperty('status', 200); done(); }); });
const toggle = document.querySelector('.toggle') const myApp = document.querySelector('.myApp') toggle.addEventListener('click', () => { if (toggle.classList.contains('active')){ toggle.classList.remove('active') myApp.classList.remove('light-theme') } else{ toggle.classList.add('active') myApp.cl...
$(document).ready(function(){ var diameter = 960, format = d3.format(",d"), color = d3.scale.category20c(); var bubble = d3.layout.pack() .size([diameter, diameter]) .padding(1.5); var svg = d3.select("body").append("svg") .attr("width", diameter) .attr("height", diameter) ...
/** * @author Administrator */ var doudizhu = { ready : function(){ }, fapai : function(){ }, jiaodizhu : function(){ }, }, helper = { isDanpai : function(){ }, isDui : function(){ }, isLianDui : function(){ }, isShun : function(){ }, isZhadan : function(){ } };
import { orderConstants } from "../constants/orderConstants.js"; export const orderCreateReducer = (state = {}, action) => { switch (action.type) { case orderConstants.ORDER_CREATE_REQUEST: return { loading: true, }; case orderConstants.ORDER_CREATE_SUCCESS: return { loading...
import {Manager} from "../manager/manager"; import {Dialog} from "dialog"; let AlternativeDialog = cc.Class({ extends: Dialog, ctor() { }, properties: { txt_desc: { default: null, type : cc.Label } }, onLoad() { this._super(); }, st...
var PaymentModel = require('../models/PaymentModel'); var Task = function (task) { this.task = task.task; this.status = task.status; this.created_at = new Date(); }; Task.insertPayment = async function insertPayment(data, result) { var payment= await PaymentModel.insertPayment(data); result(paymen...
if(sessionStorage.getItem("session") == null) { window.location.href = "index.html"; }
import { connect as reduxConnect } from 'react-redux'; import { injectAsyncReducer } from './configureStore'; export function connect(statePath, reducer, ...props) { if (statePath && reducer) { injectAsyncReducer(statePath, reducer); } return reduxConnect(...props); }
/* Global imports */ import React from "react"; import PropTypes from "prop-types"; import { Card, Icon } from "semantic-ui-react"; import styled from 'styled-components' /* Local imports */ import { getColor } from 'Utils' /* Component definition */ const CharacterCard = ({ character }) => { const { gender, name, ...
angular.module('servicioActivoCtrl', []) .controller('servicioActivoController',function($route,$scope,Servicio,Upload,$rootScope, $location, Auth, User, CLURL, CLPRE,$window, Img) { vm = this; vm.loggedIn = Auth.isLoggedIn(); vm.ofertante = Auth.esOfertante(); Auth.getUser() .then(function(data) { vm.user...
function MaximiseSampleInPlace(sample) { console.log('maximise sample in place'); var length = sample.length; var numChannels = sample.numberOfChannels; var maxValue = 0; for(var i = 0; i < numChannels; i++) { var data = sample.getChannelData(i); for(var j = 0; j < length; j++) { var value = Math.abs(da...
import React from "react" import styled from "styled-components" import { Link } from "gatsby" const Container = styled.footer` margin: 25rem 0 0; padding: 2rem 10rem; height: 15rem; background-color: #131418; display: flex; justify-content: space-between; position: relative; @media only screen and (ma...
// Place all the behaviors and hooks related to the matching controller here. // All this logic will automatically be available in application.js. $( document ).ready(function() { setEventListener(); }); function setEventListener() { $('.answer').on('click', function (e) { var $selectedAnswer = $(e.currentTarg...
var sql = require('./BaseModel'); // const Config = require('../globals/Config'); var timeController = require('../controllers/TimeController'); // const _config = new Config(); var Task = function (task) { this.task = task.task; this.status = task.status; this.created_at = new Date(); }; Task.getMenuBy...
var async = require('async'); var fs = require('fs'); var mongoose = require('mongoose'); var DocumentWord = require('./model/schema/DocumentWord'); var _ = require('lodash'); var stopwords = require('vietnamese-stopwords'); mongoose.connect('mongodb://localhost/bayes'); var db = mongoose.connection; db.on('error', f...
import React from "react"; import ChartJs from "../../components/chart-js/ChartJs"; import SmallCard from "../../components/smallCard/index"; import { Statistic, Icon, Progress, Row, Col } from "antd"; class Home extends React.Component { render() { return ( <div> <Row> <Col className="ad...
import { get } from '@/service/base' export const getSingerList = () => { return get('/api/getSingerList') } export const getSingerDetail = (singer) => { console.log('getSingerDetail', singer.mid) return get('/api/getSingerDetail', { mid: singer.mid }) }
import { getAuth,getFirestore }from "fabrica.js"; const daoSecuencia = getFirestore().collection("Secuencia"); const forma= document["forma"]; async function guardar(evt){ try { const formData = new FormData(forma); const nombre = getString(formData,"nombre").trim(); const secuencia = getString(formData...
export { default } from './users'; <body> <ul class="list-container"></ul> <script src="users.js"></script> </body>;
var searchData= [ ['ownboard_41',['ownBoard',['../class_player.html#ad2f19552b3d8bb5590b96424fed57289',1,'Player']]], ['owncoords_42',['ownCoords',['../class_ship.html#a0017c134f15f21f65354a634d0a0d61c',1,'Ship']]] ];
const env = process.env.NODE_ENV; module.exports = { purge: ["./components/**/*.tsx", "./pages/**/*.tsx"], darkMode: "class", theme: { extend: { colors: { primary: { DEFAULT: "#FF8D28", dark: "#E67F25", }, accent: { DEFAULT: "#FFBC1C", dark...
const joi = require('joi'); const schemaFindListSchedule = joi.object().keys({ idGuru : joi.number().required(), sta : joi.boolean().required() }); const schemaInsertSchedule = joi.object().keys({ idGuru : joi.number().required(), desc: joi.string().required(), member: joi.array().required() }); const sch...
import Province from './province.json'; import City from './city.json'; import District from './area.json'; export const regionMap = { provinces: Province, cities: City, districts: District, }; export const pickerArea = { area: [], allArea: [], provinces: regionMap.provinces, cities: regionMap.cities, ...
/* * Thanks to André Snede Hansen for coming up with this snippet. * I have modded it to replace + sign in text to spaces. * http://stackoverflow.com/questions/647259/javascript-query-string */ // use location search in parameter to acquire url data. function searchToObject(search) { var pairs = search.substr...
if (!String.prototype.supplant) { String.prototype.supplant = function (o) { return this.replace( /\{([^{}]*)\}/g, function (a, b) { var r = o[b]; return typeof r === 'string' || typeof r === 'number' ? r : a; } ); }; } functio...
var mongoose = require("mongoose") // Connect mongoose to your server mongoose.Promise = global.Promise; mongoose.connect("mongodb://localhost/tastyFood_app") // Define schema, or the basic layout of your collection entries var recipeSchema = new mongoose.Schema({ name: String, origin: String, cost: Numbe...
// FIZZBUZZ time! Write a program that outputs '1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, FizzBuzz, 16, 17, Fizz, 19, Buzz, and so forth until 100.' const fizzBuzz = () => { const Fizz = 'Fizz'; const Buzz = 'Buzz'; for (let i = 1; i <= 100; i += 1) { if (i % 3 === 0 && i % 5 ...
var onChangeCheckbjpk10 = onChangeCheckbjpk10 || {}; var onChangeCheckbjpk10 = { getBetsCount: function(betCount, codeAmount) { if (betCount < codeAmount) { return 0; } var betCountA = betCount; for (var i = 1; i < codeAmount; i++) { betCountA *= betCount - i;...
document.body.innerHTML = ` <web-sandbox src="/examples/vue-todomvc/index.js" csp=" default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; navigate-to 'self' google.com web-sandbox.js.org; "> </web-sandbox> <a href="https://google...
import React from 'react'; import PropTypes from 'prop-types'; import { Paper, Typography } from '@material-ui/core'; import useStyles from './styles'; const ErrorIndicator = ({ children }) => { const withChildren = !!children; const classes = useStyles(withChildren); return ( <Paper className={classes.pape...
function hackyGrab() { var $itemList = $("#detail-info > h3"); var currentIndex = -1; var emailList = []; function hasMailLink($elem) { var attr = $(this).attr("href"); return attr != null && attr.match(/^mailto:/) != null; } function grabOne() { if (currentIndex >= $i...
const Promise = require("bluebird"); const parser = Promise.promisify(require("csv-parse")); const readFile = Promise.promisify(require("fs").readFile); const mysql = require('mysql'); const _ = require("lodash"); class Input { readContents(args){ return this.read(args); } } class CsvInput exten...
const InfoServerUrl = 'http://openmd.shinnytech.com/t/md/symbols/latest.json' const QuotesServerUrl = 'ws://openmd.shinnytech.com/t/md/front/mobile' const TradeServerUrl = 'ws://t.shinnytech.com/trade/shinny' import {FormatPrice} from '@/plugins/utils' const DividerHeight = 4 // const DefaultUser = { // bid: '快期模拟'...
// page/contact.js module.exports = class Contact { constructor(util) { this.util = util; this.form = $('form'); this.submitBtn = $('input[type="submit"]'); this.form.on('submit', e => { e.preventDefault(); this.createMessage(); }); } createMessage() { const data = this.form.seriali...
import { merge, withStatus } from "litera"; import { withJson } from "litera-response-body"; import { getProfile } from "modules/user/models"; export default async (req, { db }) => merge( withStatus(200), withJson(await getProfile(db, req.headers.authorization)) );
//实例方法 /* 最重要的两个一个是 exec一个是test */ /* exec方法,专门为捕获组而设计,接收一个参数及要应用模式的字符串, 返回包含 第一个 匹配项的数组,在没有匹配项的情况下返回null 返回的数组有另外两个实例 index和input index表示匹配项在字符串中位置,input表示应用正则表达式的字符串 在数组中,第一项是与模式中捕获组匹配的字符串,如果没有捕获组则数组只有第一项 */ const str1 = 'cat dat vat' const pattern = /((cat) (dat) (vat))/gi const matches = pattern.exec(str1) console...
import React from 'react' ; import MuiAlert from '@material-ui/lab/Alert'; function TopAlert() { return ( <MuiAlert severity="info">This is an information message!</MuiAlert> ) ; } export default TopAlert ;
const defaultState = { layout_list:[] } export default (state=defaultState,action)=>{ switch(action.type){ case "HOME_LAYOUT": let layoutState = JSON.parse(JSON.stringify(state)); layoutState.layout_list = action.data; return layoutState; } return state;...
import RestClient from '../helpers/RestClient'; export default class PostApi { static fetchPostList(url) { return RestClient.instance.send({ url: '/list', data: { method: 'POST', body: JSON.stringify({ url }), }, }); } static readPost(url) { return RestClient.instan...
/** * Handle page admin user * * @version 1.0 * @author HaLe * @package ATL */ (function($) { "use strict"; var OP_LOGS = Backbone.View.extend({ el: '#atl-page-handle-logs', formClassError: 'md-input-danger', events: { 'change .op-log-filter' : 'filterByUser', 'click .op-remove-log' : 'deleteL...
define([ 'js/view/RowView', 'text!template/table.html', ], function (RowView, view_template) { /* _.templateSettings={ interpolate:/\{\{(.+?)\}\}/g };*/ //设置模板的的配置项,可以将默认的<%= %>设置为{{}} return Backbone.View.extend({ template: _.template(view_template), events: { "...
import Communication from './communication.js'; import FrontOfficeCommunication from './frontOfficeCommunication.js'; import BinaryMessages from '../../enums/binaryMessages.js' import Communications from '../../enums/communications.js' import Badges from '../../enums/badges.js' import { mqtt } from '../../server.js' c...
const http = require('http'); for (let i = 0; i < 10000; i++) { http.get( { port: 3000, hostname: 'localhost' }, function (res) { res.on('data',function (data) { console.log(data.toString()); }) } ) ...
import AbstractButton from '../abstract-button'; const MenuBarItem = AbstractButton.extend({ props: { highlighted: { type: Boolean, default: false, }, menu: { type: Object, default: () => ({}), }, }, computed: { menuBar() { return null; }, }, created() ...