text
stringlengths
7
3.69M
function SuperClass() {} SuperClass.prototype = { show : function() { console.log("this is super class method."); } } function SubClass() {} SubClass.prototype = new SuperClass(); SubClass.prototype.myShow = function() { console.log("this is sub class method."); } var sub = new SubClass(); sub.show(); sub.myShow(); //jsのプロトタイプチェーンは「インスタンスが生成された時点で固定」 //インスタンス生成後にprototypeを変更しても反映されない
'use strict'; import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; import Home from './Components/09-Routing/Home'; import About from './Components/09-Routing/About'; import Product from './Components/09-Routing/Product'; import User from "./Components/09-Routing/User"; import Navigation from "./Components/09-Routing/Nav"; import Notfound from './Components/09-Routing/NotFound'; import Tesco from './Components/10-DataRequests/Tesco'; import FilmReq from './Components/MoviesTask/Search'; const App = () => { return ( <div className="App"> <Router> <Navigation /> <Switch> <Route path="/" exact> <Home /> </Route> <Route path="/about"> <About /> </Route> <Route path="/shop"> <Product /> </Route> <Route path="/user/:id"> <User /> </Route> <Route path="/tesco"> <Tesco /> </Route> <Route path="/film" > <FilmReq/> </Route> <Route> <Notfound /> </Route> </Switch> </Router> </div> ); } export default App;
import * as d3Timer from 'd3-timer'; const d3 = { ...d3Timer }; export default function animatedGraph(canvas) { const context = canvas.getContext('2d'); const { width } = canvas; const { height } = canvas; const radius = 3; const minDistance = 60; const maxDistance = 45; const minDistance2 = minDistance * minDistance; const maxDistance2 = maxDistance * maxDistance; const tau = 2 * Math.PI; const n = 200; const particles = new Array(n); for (let i = 0; i < n; ++i) { particles[i] = { x: Math.random() * width, y: Math.random() * height, vx: 0, vy: 0 }; } return d3.timer(() => { context.save(); context.clearRect(0, 0, width, height); for (let i = 0; i < n; ++i) { const p = particles[i]; p.x += p.vx; if (p.x < -maxDistance) p.x += width + maxDistance * 2; else if (p.x > width + maxDistance) p.x -= width + maxDistance * 2; p.y += p.vy; if (p.y < -maxDistance) p.y += height + maxDistance * 2; else if (p.y > height + maxDistance) p.y -= height + maxDistance * 2; p.vx += 0.2 * (Math.random() - 0.5) - 0.01 * p.vx; p.vy += 0.2 * (Math.random() - 0.5) - 0.01 * p.vy; context.beginPath(); context.arc(p.x, p.y, radius, 0, tau); context.fillStyle = 'rgba(40,217,242,0.4)'; context.fill(); } for (let i = 0; i < n; ++i) { for (let j = i + 1; j < n; ++j) { const pi = particles[i]; const pj = particles[j]; const dx = pi.x - pj.x; const dy = pi.y - pj.y; const d2 = dx * dx + dy * dy; if (d2 < maxDistance2) { context.globalAlpha = d2 > minDistance2 ? (maxDistance2 - d2) / (maxDistance2 - minDistance2) : 1; context.beginPath(); context.moveTo(pi.x, pi.y); context.lineTo(pj.x, pj.y); context.strokeStyle = 'rgba(40,217,242,0.3)'; context.stroke(); } } } context.restore(); }); }
OC.L10N.register( "settings", { "Authentication error" : "Gwall dilysu", "Email sent" : "Anfonwyd yr e-bost", "Delete" : "Dileu", "Share" : "Rhannu", "Invalid request" : "Cais annilys", "Groups" : "Grwpiau", "undo" : "dadwneud", "never" : "byth", "None" : "Dim", "Save" : "Cadw", "Login" : "Mewngofnodi", "Encryption" : "Amgryptiad", "Add" : "Ychwanegu", "Cancel" : "Diddymu", "Email" : "E-bost", "Password" : "Cyfrinair", "New password" : "Cyfrinair newydd", "Name" : "Enw", "Username" : "Enw defnyddiwr", "Personal" : "Personol", "Admin" : "Gweinyddu", "Settings" : "Gosodiadau", "Other" : "Arall" }, "nplurals=4; plural=(n==1) ? 0 : (n==2) ? 1 : (n != 8 && n != 11) ? 2 : 3;");
import React, {Component, Fragment} from 'react'; import {connect} from 'react-redux'; import {bindActionCreators} from 'redux'; import {Button, message, Popconfirm, Table, Tag, Divider, Select, Input, Icon, BackTop, DatePicker} from "antd"; import moment from 'moment'; import {Link} from 'react-router-dom'; import MainLoader from "../common/Main Loader"; import * as ingresosActions from '../../redux/actions/administracion/ingresosActions'; import * as linesActions from '../../redux/actions/blines/blinesActions'; import * as cuentasActions from '../../redux/actions/cuentas/cuentasActions'; import * as clientesActions from '../../redux/actions/administracion/clientesActions'; import * as empresasActions from '../../redux/actions/empresasActions'; import FormIngreso from "./IngresoForm"; const { RangePicker } = DatePicker; const Option = Select.Option; const style={ customFilterDropdown: { padding: 8, borderRadius: 6, backgroundColor: 'white', boxShadow: '0 1px 6px rgba(0, 0, 0, .2)' }, customFilterDropdownInput: { width: 130, marginRight: 8, } }; const opciones = [{ name :'Cerdos', id: 1 }, { name:'Ganado', id:2 }, { name:'Granos', id:3 }, { name:'Planta de alimentos', id:4 }, { name:'Campo', id:5 }, ]; class IngresosPage extends Component { state = { visible: false, selectedRowKeys:[], data:[], filterDropdownVisible: false, searchText: '', filtered: false, linea:'', cuenta:'', cliente:'', canReset:false, venta:false, idClient:null, idLine:null, idReceivable:null, idCompany:null }; componentWillMount(){ this.props.ingresosActions.getIngresos(); } showModal = () => { this.setState({ visible: true, }); }; handleCancel = () => { this.setState({ visible: false, venta:false, }); const form = this.form; form.resetFields(); }; deleteIngreso=()=>{ let keys = this.state.selectedRowKeys; for(let i in keys){ this.props.ingresosActions.deleteIngreso(keys[i]) .then(r=>{ console.log(r) }).catch(e=>{ console.log(e) }) } this.setState({selectedRowKeys:[]}) }; confirm=(e)=> { console.log(e); this.deleteIngreso(); message.success('Deleted successfully'); }; cancel=(e) =>{ console.log(e); }; onSelectChange = (selectedRowKeys) => { console.log('selectedRowKeys changed: ', selectedRowKeys); this.setState({ selectedRowKeys }); }; saveFormRef = (form) => { this.form = form; }; handleCreate = (e) => { const form = this.form; e.preventDefault(); form.validateFields((err, values) => { if (!err) { console.log(values); values['client_id']=this.state.idClient; values['business_line_id']=this.state.idLine; values['receivable_id']=this.state.idReceivable; values['empresa_id']=this.state.idCompany; this.props.ingresosActions.saveIngreso(values) .then(()=>{ message.success('Guardado con éxito'); form.resetFields(); this.setState({ visible: false }); }).catch(e=>{ console.log(e.response) }) }else{message.error('Algo fallo, verifica los campos');} }); }; handleChange = e => { console.log("name", e.target.id) if(e.target.id === "sale_check"){ this.setState({ factura: e.target.checked }) } if(e.target.id === "is_sale"){ this.setState({ venta: e.target.checked }) } }; handleSale = () =>{ } onSearch = () => { // let basePath= "http://localhost:8000/api/ingresos/ingresos/?q="; let basePath = 'https://rancho.davidzavala.me/api/ingresos/ingresos/?q='; let url = basePath+this.state.searchText; this.props.ingresosActions.getIngresos(url); this.setState({canReset:true}) }; resetFilter = () => { //let basePath= "http://localhost:8000/api/ingresos/ingresos/"; let basePath = 'https://rancho.davidzavala.me/api/ingresos/ingresos/'; this.props.ingresosActions.getIngresos(basePath); this.setState({ searchText:'', canReset:false }); }; handlePagination=(pagina)=>{ let nextLength = pagina.toString().length; let newUrl = this.props.ingresosData.next; if(newUrl===null){ newUrl = this.props.ingresosData.previous; } if( pagina ==1 && this.props.ingresosData.count <= 20){ newUrl='http'+newUrl.slice(4,newUrl.length); }else{ newUrl='http'+newUrl.slice(4,newUrl.length-nextLength)+pagina; } this.props.ingresosActions.getIngresos(newUrl); }; handleSearch=(e)=>{ this.setState({searchText:e.target.value}) }; handleSearchLine=(a)=>{ // let basePath = 'http://127.0.0.1:8000/api/ingresos/blines/?q='; let basePath = 'https://rancho.davidzavala.me/api/ingresos/blines/?q='; let url = basePath+a; this.props.linesActions.getLiSearch(url); }; //Cuentas handleCuenta=(a)=>{ //let basePath = 'http://127.0.0.1:8000/api/ingresos/cuentas/?q='; let basePath = 'https://rancho.davidzavala.me/api/ingresos/cuentas/?q='; let url = basePath+a; this.props.cuentasActions.getCuSearch(url); }; //Cliente handleCliente=(a)=>{ //let basePath = 'http://127.0.0.1:8000/api/ingresos/clientes/?q='; let basePath = 'https://rancho.davidzavala.me/api/ingresos/clientes/?q='; let url = basePath+a; this.props.clientesActions.getClSearch(url); }; //Cuentas handleEmpresas=(a)=>{ //let basePath = 'http://127.0.0.1:8000/api/ingresos/empresas/?q='; let basePath = 'https://rancho.davidzavala.me/api/ingresos/empresas/?q='; let url = basePath+a; //this.props.cuentasActions.getCuSearch(url); }; handleDates=(a, b)=>{ let basePath = 'http://localhost:8000/api/ingresos/ingresos/?'; //let basePath = 'https://rancho.davidzavala.me/api/ingresos/ingresos/?'; let url = basePath+`date1=${b[0]}&date2=${b[1]}` console.log(a, b) this.props.ingresosActions.getIngresos(url); this.setState({canReset:true}) } //saveIDClient saveCompany=(id)=>{ this.setState({idCompany:id}) }; saveClient=(id)=>{ this.setState({idClient:id}) }; saveLine=(id)=>{ this.setState({idLine:id}) }; saveReceivable=(id)=>{ this.setState({idReceivable:id}) }; render() { const columns = [ { title: 'Razón Social', dataIndex: 'empresa', render: (empresa,obj) =><Link to={`/admin/ingresos/${obj.id}`}>{ empresa && empresa !== null ? empresa.company || empresa: "None"}</Link>, key:'empresa', }, { title: 'Linea de negocio', dataIndex: 'business_line', render: (business_line,obj) =><span>{ business_line && business_line !== null ? business_line.name : "No Linea"}</span>, }, { title: 'No. Factura', dataIndex: 'no_scheck', render:no_scheck=> <span>{no_scheck && no_scheck !==null ?<span>{no_scheck}</span>:'No hay factura'}</span> }, { title: 'Status', dataIndex:'paid', render:(paid, obj)=><span>{ paid?<Tag color="#87d068" style={{width:70, textAlign:'center'}} >Pagado</Tag>: <Tag color="yellow" style={{width:70, textAlign:'center'}}>Por Pagar</Tag> }</span> }, { title: 'Status', dataIndex:'sale_date', render:(sale_date, obj)=>{ return(<span>{ obj.paid?<Tag color="green">Todo Bien</Tag>:obj.client && sale_date && moment.duration(new Date() - new Date(sale_date)).asDays() > parseInt(obj.client.credit) ?<Tag color="#f50">Vencido</Tag>:<Tag color="green">En tiempo</Tag> }</span>)} }, /*{ title: 'Registro', dataIndex: 'created', render: created => moment(created).startOf(3, 'days').calendar() },*/ ]; const { visible, selectedRowKeys, data, filtered, searchText, canReset } = this.state; const canDelete = selectedRowKeys.length > 0; const rowSelection = { selectedRowKeys, onChange: this.onSelectChange, }; let {ingresos, fetched, clientes, ingresosData, blines, cuentas,empresas} = this.props; let options = opciones.map((a) => <Option key={a.name}>{a.name}</Option>); if(!fetched)return(<MainLoader/>); console.log("empresas",empresas) return ( <Fragment> <div style={{marginBottom:10, color:'rgba(0, 0, 0, 0.65)' }}> Administración <Divider type="vertical" /> Ingresos </div> <h1>Ingresos Page</h1> <div style={{marginBottom:'1%', display:'flex'}}> <Input.Search enterButton onSearch={this.onSearch} onChange={this.handleSearch} value={searchText} style={{ width: 400 }} placeholder={'Buscar ingreso...'} /> <Divider type="vertical" /> <RangePicker onChange={this.handleDates} /> </div> <BackTop visibilityHeight={100} /> <Table dataSource={ingresos} columns={columns} rowSelection={rowSelection} rowKey={record => record.id} scroll={{x:650}} style={{marginBottom:10}} pagination={{ pageSize: 10, total:ingresosData.count, onChange:this.handlePagination, showTotal:total => `Total: ${total} Ingresos` }} /> <Button type="primary" onClick={this.showModal}>Agregar</Button> <FormIngreso ref={this.saveFormRef} visible={visible} onCancel={this.handleCancel} onCreate={this.handleCreate} handleChange={this.handleChange} factura = {this.state.factura} venta ={this.state.venta} options={blines} searchLine={this.handleSearchLine} cuentas={cuentas} searchCuenta={this.handleCuenta} options_empresas={empresas} searchEmpresas={this.handleEmpresas} saveCompany={this.saveCompany} options_clientes={clientes} searchCliente={this.handleCliente} saveClient={this.saveClient} saveLine={this.saveLine} saveReceivable={this.saveReceivable} /> <Divider type={'vertical'}/> <Popconfirm title="Are you sure delete this ingreso?" onConfirm={this.confirm} onCancel={this.cancel} okText="Yes" cancelText="No"> <Button disabled={!canDelete} type="primary" >Eliminar</Button> </Popconfirm> <Divider type={'vertical'} /> <Button type="primary" disabled={!canReset} onClick={this.resetFilter}>Borrar filtro</Button> </Fragment> ); } } function mapStateToProps(state, ownProps) { return { empresas:state.empresas.list, ingresos:state.ingresos.list, ingresosData:state.ingresos.allData, blines:state.blines.lineSearch, fetched: state.ingresos.list !== undefined && state.clientes.list !==undefined && state.blines.lineSearch !== undefined && state.cuentas.cuentaSearch !== undefined && state.empresas.list, clientes:state.clientes.clienteSearch, cuentas:state.cuentas.cuentaSearch } } function mapDispatchToProps(dispatch) { return { ingresosActions: bindActionCreators(ingresosActions, dispatch), empresasActions:bindActionCreators(empresasActions,dispatch), linesActions: bindActionCreators(linesActions, dispatch), cuentasActions: bindActionCreators(cuentasActions, dispatch), clientesActions: bindActionCreators(clientesActions, dispatch), } } IngresosPage = connect(mapStateToProps, mapDispatchToProps)(IngresosPage); export default IngresosPage;
import React, { useState } from "react"; import { Link } from "react-router-dom"; import Button from "@material-ui/core/Button"; import Grid from "@material-ui/core/Grid"; import Typography from "@material-ui/core/Typography"; import TextField from "@material-ui/core/TextField"; function RoomJoinPage({ history }) { const [roomCode, setRoomCode] = useState(""); const [error, setError] = useState(""); const joinRoom = () => { console.log("joining room"); console.log(roomCode); const requestOptions = { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ code: roomCode, }), }; fetch("/api/join-room", requestOptions) .then((res) => { if (res.ok) { history.push(`/room/${roomCode}`); setRoomCode(""); } else { setError("Room not found"); } }) .catch((err) => console.log(err)); }; return ( <Grid container spacing={1} className={"page"}> <Grid item xs={12} align="center"> <Typography variant="h4" component="h4"> Join a Room </Typography> </Grid> <Grid item xs={12} align="center"> <TextField error={error} color="secondary" label="Code" onChange={(e) => setRoomCode(e.target.value)} value={roomCode} helperText={error} placeholder="Enter a Room Code" variant="outlined" /> </Grid> <Grid container justify="space-around" style={{ height: 50 }}> <Button color="secondary" component={Link} to="/"> Back </Button> <Button variant="contained" color="secondary" onClick={() => joinRoom()} > Enter Room </Button> </Grid> </Grid> ); } export default RoomJoinPage;
generateJoke(); function generateJoke() { // API const request = new XMLHttpRequest() request.open('GET', 'https://api.chucknorris.io/jokes/random?category={category}', true) request.onload = function() { // DB const data = JSON.parse(this.response) // PICK A RANDOM JOKE const item = data[Math.floor(Math.random() * data.length)] document.getElementById('joke').innerHTML = `${item.jokes}`; }; request.send() };
import React, { useState, useEffect } from 'react' import './App.css' import Header from './components/Header' import Footer from './components/Footer' import SectionHeading from './components/SectionHeading' import ResultTrending from './components/ResultTrending' import ResultSearch from './components/ResultSearch' function App() { const API_KEY = '396f9c8444e7ff20a696e93cc4ed6e46' // create the state for components const [searchResults, setSearchResults] = useState([]) const [query, setQuery] = useState([]) const [error, setError] = useState(false) const [trending, setTrending] = useState([]) const [showTrending, setShowTrending] = useState(true) // main methods const fetchTrendingData = async (e, name) => { fetchQueryInputData(e, name ) } const getTrending = async () => { const url = `https://api.themoviedb.org/3/trending/all/day?api_key=${API_KEY}` try { const res = await fetch(url) const data = await res.json() setTrending(data.results) }catch(err){ console.log(err) } } const fetchQueryInputData = async (e, query) => { e.preventDefault() setSearchResults([]) setShowTrending(false) setQuery(query) const url = `https://api.themoviedb.org/3/search/multi?api_key=${API_KEY}&language=en-US&query=${query}&include_adult=false` try { const res = await fetch(url) const data = await res.json() data.results.length ? setSearchResults(data.results) : setError(true) } catch(err){ console.log(err) } } useEffect(() => { getTrending() },[]) return ( <div className="App"> <Header fetchQueryInputData={fetchQueryInputData} /> <div className="content"> <div className="section"> <SectionHeading error={error} query={query} searchResultsLength={searchResults.length} /> { showTrending ? <> <ResultTrending trending={ trending } fetchTrendingData={fetchTrendingData} /> </> : '' } <ResultSearch searchResults={searchResults} fetchQueryInputData={fetchQueryInputData}/> </div> </div> <Footer /> </div> ) } export default App
import React, { useState, useEffect } from "react"; import axios from "axios"; import CharCard from "./CharCard"; import { Container, Row } from "reactstrap"; export default function List() { const [chars, setChars] = useState([]); useEffect(() => { axios .get(`https://swapi.co/api/people/`) .then(response => { // console.log(response.data.results) setChars(response.data.results); }) .catch(error => { console.log(`The data was not returned; ${error}`); }); }, []); return ( <Container style={{marginBottom: '5%'}}> <Row> {chars.map(char => { return ( <CharCard key={char.index} name={char.name} homeworld={char.homeworld} /> ); })} </Row> </Container> ); }
Object.defineProperty(exports, "__esModule", { value: !0 }), exports.default = void 0; var _default = Behavior({ lifetimes: { created: function created() { this.nextCallback = null; }, detached: function detached() { this.cancelNextCallback(); } }, methods: { safeSetData: function safeSetData(t, a) { var e = this; this.pendingData = Object.assign({}, this.data, t), a = this.setNextCallback(a), this.setData(t, function() { e.pendingData = null, a(); }); }, setNextCallback: function setNextCallback(a) { var e = this, l = !0; return this.nextCallback = function(t) { l && (l = !1, e.nextCallback = null, a.call(e, t)); }, this.nextCallback.cancel = function() { l = !1; }, this.nextCallback; }, cancelNextCallback: function cancelNextCallback() { null !== this.nextCallback && (this.nextCallback.cancel(), this.nextCallback = null); } } }); exports.default = _default;
/* eslint-disable react/forbid-prop-types,global-require */ import React from 'react'; import {Form, Table} from 'antd'; const columns = [ { title: 'No', dataIndex: 'no', render: (text, record, index) => `${index+1}` }, { title: '任务周期', dataIndex: 'period_name', },{ title: '计划完成', dataIndex: 'planning', }, { title: '实际完成', dataIndex: 'fact' }, { title: '差异原因', dataIndex: 'difference' }, { title: '计划用时', dataIndex: 'time_plan' }, { title: '实际用时', dataIndex: 'time_fact' } ]; class Detail1 extends React.Component { state={ data:[],aa:true } async componentDidMount() { // console.log(this.props.taskData) await this.props.form.resetFields(); await this.setState({ data: this.props.searchData1, }); } render(){ return( <div><Table bordered={true} columns={columns} dataSource={this.state.data} aa={this.state.aa}/></div> ); } } const WrappedRegistrationForm = Form.create({ name: 'addTask' })(Detail1); export default WrappedRegistrationForm;
var infowindow = null; var allMarkers = []; var savedSearch = new Firebase("https://withinreach.firebaseio.com/"); function initialSearch(keywords, home) { var searchLocation = "&l="+home; var searchKeyword = "&q="+keywords; var limit = "&limit="; var resultsnum = 10; var pageNumber = 1; var first = true; buildResults(searchKeyword,searchLocation,limit,resultsnum,pageNumber,first,home); } function buildResults(searchKeyword,searchLocation,limit,resultsnum,pageNumber,first,home){ var searchKey =searchKeyword; var searchLoc = searchLocation; var lim = limit; var resultsNumber = resultsnum; var pagenum = pageNumber; var initialSearch = first; var center = home; var queryURL = "//api.indeed.com/ads/apisearch?publisher=8023780673544955&format=json"+searchKey+searchLoc+lim+resultsNumber+"&v=2"; $.ajax({ url: queryURL, method: 'GET', crossDomain: true, dataType: 'jsonp' }) .done(function(response) { var results = response.results var numResults = response.totalResults; for (var i = 0; i < results.length; i++) { var jobTitle = results[i].jobtitle; var company = results[i].company; var location = results[i].formattedLocationFull; var snippet = results[i].snippet; var link = results[i].url; var jobKey = results[i].jobkey; // $("#resultsList").append(string); $("#resultsList").append("<a href="+link+" target=\"_blank\" ><div class=\"searchResult\" id="+jobKey+"><h2>" + jobTitle + "</h2><p>" + company + " - " + location + "</p><p>" + snippet + "</p></div></a>"); $("#resultsList").append("<div class=\"searchResult\" id="+jobKey+"><a href="+link+" target=\"_blank\" ><h2>" + jobTitle + "</h2><p>" + company + " - " + location + "</p><p>" + snippet + "</p></a></div>"); } if ( Math.ceil(numResults / 10) > pagenum ){ $("#resultsList").append("<button type=\"button\" class=\"btn btn-default center-block\" id=\"nextPage\">Next 10 <span class=\"glyphicon glyphicon-chevron-right\" aria-hidden=\"true\"></span></button>"); $('#nextPage').click(function(){ //initMap(); if (initialSearch) { var start = '&start='; initialSearch = false; pagenum++; buildResults(searchKey,searchLoc,start,resultsNumber,pagenum,initialSearch,center); } else { var start = '&start='; pagenum++; resultsNumber = resultsNumber + 10; buildResults(searchKey,searchLoc,start,resultsNumber,pagenum,initialSearch,center); } }); } if ( pagenum > 1 ){ $("#resultsList").append("<button type=\"button\" class=\"btn btn-default center-block\" id=\"previousPage\"><span class=\"glyphicon glyphicon-chevron-left\" aria-hidden=\"true\"></span> Previous 10</button>"); $('#previousPage').click(function(){ //initMap(); getCenter(center); if (pagenum == 2) { var limit = "&limit="; first = true; resultsNumber = 10; pagenum--; buildResults(searchKey,searchLoc,limit,resultsNumber,pagenum,first,center); } else { var start = '&start='; pagenum--; resultsNumber = resultsNumber - 10; buildResults(searchKey,searchLoc,start,resultsNumber,pagenum,first,center); } }); } }); } $('#seeResults').click(function(){ var keywords = $('#keywords').val().trim(); var home = $('#location').val().trim(); if (home !== ''){ initialSearch(keywords, home); $('#keywords').val(''); $('#location').val(''); // $('.navbar').show(); $('.results').show(); $('#search').hide(); $('#map2').hide(); } else { $('#myModal').modal('show'); } return false; }); $('#seeResultsNav').click(function(){ var keywords = $('#keywordsNav').val().trim(); var home = $('#locationNav').val().trim(); if (home !== ''){ initialSearch(keywords, home); $('#keywords').val(''); $('#location').val(''); } else { $('#myModal').modal('show'); } return false; }); $('#currentLocNav').click(function(){ var startPos; var geoOptions = { maximumAge: 5 * 60 * 1000, timeout: 10 * 1000, } });
import styled from 'styled-components' export const NoteContainer = styled.div` padding: 16px; background-color: white; `;
/** * <描述> * * @author lilw * @date: 2016/12/20 * @version: v1.0 */ 'use strict'; var express = require('express'); var router = express.Router(); var articleController=require("./article.controller.js"); //查询全部文章 router.get("/queryAll",articleController.queryAll); module.exports = router;
const API_ROOT = 'https://evening-peak-84473.herokuapp.com' const headers = () => { return { 'Content-Type': 'application/json', Accepts: 'application/json', Authorization: localStorage.getItem('token') } }; const login = data => { return fetch(`${API_ROOT}/auth`, { method: 'POST', headers: headers(), body: JSON.stringify(data) }).then(res => { if(res.ok) { return res.json() } else { return {error: "Not a valid username or password"} } }); }; const signup = data => { return fetch(`${API_ROOT}/users`, { method: "POST", headers: headers(), body: JSON.stringify(data) }).then(res => { if(res.ok) { return res.json() } else { return {error: "Not a valid profile"} } }) } const getCurrentUser = () => { return fetch(`${API_ROOT}/current_user`, { method: "GET", headers: headers() }).then(res => { if(res.ok) { return res.json() } else { return {error: "Not a valid profile"} } }) }; const editCurrentUser = (data) => { return fetch(`${API_ROOT}/current_user`,{ method: "PATCH", headers: headers(), body: JSON.stringify(data) }).then(resp => { if(resp.ok) { return resp.json() } else { return {error: "Not a valid profile"} } }) } const deleteCurrentUser = () => { return fetch(`${API_ROOT}/current_user`, { method: "DELETE", headers: headers(), }).then(resp => { if(resp.ok) { return resp.json() } else { return {error: "Not a valid profile"} } }) } const createEvent = (data) => { return fetch(`${API_ROOT}/events`, { method: "POST", headers: headers(), body: JSON.stringify(data) }).then(res => { if(res.ok) { return res.json() } else { return {error: "Not a valid profile"} } }) } const deleteEvent = (data) => { return fetch(`${API_ROOT}/events/${data}`, { method: "DELETE", headers: headers() }).then(res => { if(res.ok) { return res.json() } else { return {error: "Not a valid profile"} } }) } const fetchPlaces = (search) => { return fetch(`${API_ROOT}/google_api`, { method: "POST", headers: { Accept: 'applicaton/json', 'Content-Type': 'application/json' }, body: JSON.stringify({google_api: search}) }) .then(resp => resp.json()) } const fetchAddress = (search) => { return fetch(`${API_ROOT}/google_api/geocode`, { method: "POST", headers: { Accept: 'application/json', 'Content-Type': 'application/json' }, body: JSON.stringify(search) }).then(resp => resp.json()) } const api = { auth: { login, getCurrentUser, editCurrentUser, deleteCurrentUser }, user: { signup, }, event: { createEvent, deleteEvent }, google: { fetchPlaces, fetchAddress } } export { api }
var through = require('through2') module.exports = pass; function pass(writable) { var stream = through(function (chunk, enc, callback) { writable.write(chunk, enc); this.push(chunk, enc); callback(); }); return stream; }
module.exports = function(api, options, rootOptions) { var normalizedLocales = options.locales .split(',') .map(locale => locale.trim().toLowerCase()) api.extendPackage({ vue: { pluginOptions: { moment: { locales: normalizedLocales, }, }, }, }); }
import React, { Component } from "react"; import "./Message.css"; import MessageInfo from "./MessagesInfo"; import Message from "./Message"; class PostContainer extends Component { constructor(props) { super(props); } render() { var Messages = MessageInfo.messages; return ( <> {Messages.map((message) => ( <> <Message message={message} /> </> ))} </> ); } } export default PostContainer;
/* * @Description: axios 封装 * @version: 0.1.0 * @Author: wsw * @LastEditors: wsw * @Date: 2019-04-24 15:30:54 * @LastEditTime: 2019-04-24 15:39:35 */ import Axios from 'axios' const axios = Axios.create({ baseURL: '', timeout: 60000 }) const checkStatus = res => { if (res.status >= 200 && res.status < 300) { return res } throw new Error(res.statusText) } const request = async (url, config = {}) => { try { const res = await axios.request({ url, ...config }) checkStatus(res) return await res.data } catch (err) { alert('request failed with error') } } const requestAll = async (urls) => { let requests = urls.map(makeRequest) const res = await Axios.all(requests) return res } const makeRequest = url => { return Axios.get(url) } export default { request, requestAll }
import reducer from './region.reducer' import actions from './region.actions' export default { STORE_NAME: 'region', reducer, actions, }
/* * kitsComponent.js * * Copyright (c) 2016 HEB * All rights reserved. * * This software is the confidential and proprietary information * of HEB. */ 'use strict'; /** * Kits -> Kits Info page component. * * @author m594201 * @since 2.8.0 */ (function () { angular.module('productMaintenanceUiApp').controller('ImageUploadController', imageUploadController); imageUploadController.$inject = ['HomeApi','$location','$scope','$rootScope','productSellingUnitsApi', 'ngTableParams']; function imageUploadController(homeApi,$location,$scope,$rootScope, productSellingUnitsApi, ngTableParams) { var self = this; /** * This list holds all of the uploaded images. * @type {Array} */ self.imagesUploadedToExport=[]; /** * This list holds a of the upload image. * @type {Array} */ // self.imageUpload=[]; /** * This list holds all of the possible image categories * @type {Array} */ self.imageCategories=[]; /** * The currently selected image category * @type {null} */ self.imageCategory=null; /** * This list holds all of the possible image sources * @type {Array} */ self.imageSources =[]; /** * The currently selected image source * @type {null} */ self.imageSource = null; /** * This list holds all of the possible destination domains * @type {Array} */ self.destinationDomains = []; /** * The list of currently selected destination domains * @type {Array} */ self.selectedDestinations = []; /** * Flag for when all images are selected to be uploaded * @type {boolean} */ self.uploadAllChecked=false; /** * Flag for when all images are selected to replace the current primary * @type {boolean} */ self.primaryAllChecked=false; /** * Flag for when all alternate images are selected to upload with show on site * @type {boolean} */ self.showOnSiteAllChecked=false; /** * Flag for when all images are selected to replace the current alternate * @type {boolean} */ self.alternateAllChecked=false; /** * Flag for whether or not to continue uploading images * @type {boolean} */ self.continueUploads=false; /** * Flag for if uploads are currently occurring * @type {boolean} */ self.isUploading = false; /** * Keeps track if the image is still uploading to server or not. * @type {boolean} */ $rootScope.isStillUploadImage = false; /** * List of images to be potentially uploaded * @type {Array} */ self.imageData = []; /** * Code table for Existing image action dropdown * These actions are reserved for what to do with the current image image * if the new image is set to replace the current image * @type {*[]} */ self.existingImageAction = []; /** * Code table for Existing primary action dropdown * These actions are reserved for what to do with the current primary image * if the new image is set to replace the current primary * @type {*[]} */ self.existingPrimaryAction = [ { description: 'Inactivate', keyword: 'INACT' }, { description: 'Reject', keyword: 'REJ' }, { description: 'Alternate', keyword: 'ALT' } ]; /** * Code table for Existing alternate action dropdown * These actions are reserved for what to do with the current alternate image * if the new image is set to replace the current alternate * @type {*[]} */ self.existingAlternateAction = [ { description: 'Inactivate', keyword: 'INACT' }, { description: 'Reject', keyword: 'REJ' }, { description: 'None', keyword: null } ]; /** * Message for no primary or alternate image selected * @type {string} */ self.MESSAGE_NO_PRIMARY_OR_ALTERNATE_SELECTED = "Please select \"Set As Primary\" flag or \"Set As Alternate\" flag before uploading image"; /** * Message for no destination selected * @type {string} */ self.MESSAGE_NO_DESTINATION_SELECTED = "Please select at least one Destination Domain."; /** * Message for no confirm before upload images * @type {string} */ self.MESSAGE_CONFIRM = ""; /** * The currently selected existing primary header. * @type {Object} */ self.existingImageHeader = null; /** * These variables are parameters for the paginated table, this is the start page and the number of elements per page * @type {number} */ self.START_PAGE =1; self.PAGE_SIZE =7; /** * The paramaters that define the table showing the report. * @type {ngTableParams} */ self.tableParams = null; /** * Swatches Category Code * @type {string} */ self.CATEGORY_SWATCHES = 'SWAT'; /** * List of valid file types * @type {[string,string,string,string,string]} */ self.validFileTypes = ["jpg", "jpeg", "png"]; /** * Initialize the default values for countUploadProcess and totalSuccessfullyUploaded and totalFailedUploaded. * @type {number} */ self.countUploadProcess = 0; self.totalSuccessfullyUploaded = 0; self.totalFailedUploaded = 0; /** * This message is showed if the image does not meet specifications. * @type {string} */ self.imageDoesNotMeetSpecifications = "Does not meet criteria."; /** * Initialize some const values. */ const EMPTY = ""; const UPLOAD_SUCCESS_MESSAGE = "Successfully Updated."; const UPLOAD_FAILED_MESSAGE = "Image Upload Failed."; const UPLOAD_NOT_SUCCESSFUL = "Not Successful."; const DOES_NOT_MEET_CRITERIA = "Does not meet criteria."; const INVALID_IMAGE_NAME = "Invalid image name, must start with possible UPC."; const SUCCESSFUL = "Successful."; /** * Alternate Images cannot be Show On Site without a Primary Image that is show On Site. * @type {string} */ const UPLOAD_ALTERNATE_WITHOUT_PRIMARY_IMAGE = "Alternate Images cannot be \"Show On Site\" without a Primary Image that is \"Show On Site\""; var START_INDEX = 0; /** * Initialize the controller. */ this.$onInit = function () { self.currentPage = $location.url(); //self.existingImageHeader = self.existingImageAction[0]; productSellingUnitsApi.getImageCategories(self.loadCategories, self.fetchError); productSellingUnitsApi.getImageSources(self.loadSources, self.fetchError); productSellingUnitsApi.getImageDestinations(self.loadDestinations, self.fetchError); self.addFileCheckToBrowse(); self.buildTable(); }; /** * The DownloadButton is enable or not. * @return {boolean} */ self.isDownloadButtonDisable = function(){ if(self.imageData.length === 0){ return true; } for(var index = 0; index<self.imageData.length; index++){ if(self.imageData[index].statusUpload !== undefined){ return false; } } return true; }; /** * Show message to user when moving another page if the images are still uploading. */ $scope.$on('$stateChangeStart', function (event, toState) { self.nextPage = toState.url; if(!angular.equals(self.currentPage , toState.url) && self.isUploading && !self.userHasClickedNavigate){ event.preventDefault(); $("#confirmToNavigate").modal("show"); } }); /** * This method will signal the api to stop uploading images and navigate to another page that user have choosed. */ self.stopUploadImagesAndNavigate = function(){ self.userHasClickedNavigate = true; self.stopUploads(); self.removeModalConfirmToNavigate(); $location.path(self.nextPage); }; /** * This method will hide the modal confirmToNavigate and remove its modal-backdrop. */ self.hideModalConfirmToNavigate = function(){ self.removeModalConfirmToNavigate(); }; /** * This method will hide the modal confirmToNavigate and remove its modal-backdrop. */ self.removeModalConfirmToNavigate = function(){ $('#confirmToNavigate').modal('hide'); $('body').removeClass('modal-open'); $('.modal-backdrop').remove(); }; /** * This method will navigate to another page that user have choosed. */ self.navigateToAnotherPage = function(){ self.removeModalConfirmToNavigate(); $location.path(self.nextPage); }; /** * This method to initialize var search and format name of the image. */ self.initializeVarSearchAndFormatImageName = function (imageData) { var search = {}; search.firstSearch = true; search.page = 0; search.pageSize = 25; var upcs = EMPTY; if(imageData.name.match(/_/) !== null){ upcs=Number(imageData.name.split('_')[0]); } else{ upcs=Number(imageData.name.split('.')[0]); } search.upcs = upcs; return search; }; /** * This method will create an event listener to the upload button so that when files are added to the input, * all of the files are check to see if they are valid */ self.addFileCheckToBrowse = function () { var uploadImageData = document.getElementById("selectedFiles"); var imageTypeCode = EMPTY ; self.invalidFileType = true; uploadImageData.addEventListener('change', function (e) { self.primaryAllChecked=false; self.alternateAllChecked=false; self.showOnSiteAllChecked=false; self.uploadImageName = EMPTY; var imageDataOrg = angular.copy(self.imageData); angular.forEach(uploadImageData.files, function (imageData) { imageTypeCode = imageData.type.split('/').pop(); if (self.validFileTypes.indexOf(imageTypeCode.toLowerCase()) > -1) { self.uploadImageName = imageData.name; self.invalidFileType = false; var reader = new FileReader(); reader.onloadend = function () { var imageCandidate={ name: imageData.name, size: (imageData.size/1000).toFixed(2) + ' Kb', status: status === EMPTY ? self.determineStatus(imageData.name.split('.')[0]) : status, success: null, setToPrimary: false, existingImage: null, setToAlternate: false, setToShowOnSite: false, destinationDomain: self.destinationDomains, toUpload:false, isUploading:false, data: reader.result.split(',').pop() }; self.checkImageUniqueAndResetData(imageCandidate , imageDataOrg); }; reader.readAsDataURL(imageData); } else { self.invalidFileType = true; } self.firstSearch=true; }); angular.element(uploadImageData).val(null); }); }; /** * This method checks if the image is unique or not and reset if data is changed. */ self.checkImageUniqueAndResetData = function (imageCandidate , imageDataOrg){ if(self.imageUnique(imageCandidate)){ self.imageData.push(imageCandidate); } if(angular.toJson(self.imageData) !== angular.toJson(imageDataOrg)){ //reset if data is changed self.updateImageDataTable(); var loadFirstTime = true; angular.forEach(imageDataOrg, function(image){ if(self.isValidToChange(image)){ loadFirstTime = false; } }); if(loadFirstTime){ //self.existingImageHeader = self.existingImageAction[0]; } } }; /** * This method checks if the image is unique based on name and data; * @param image * @returns {boolean} */ self.imageUnique = function (image) { var notFound = true; for(var index = 0; index<self.imageData.length; index++){ if(angular.equals(image.name, self.imageData[index].name) && angular.equals(image.data, self.imageData[index].data)){ notFound = false; break; } } return notFound; }; /** * This method does a series of regex tests to see if the name of the file is valid * @param name * @returns {string} */ self.determineStatus= function (name ,size) { var status = EMPTY; var letters = /[a-zA-Z]/; var numberAndSpecialCharacter = /^[0-9_]+$/; var legalCharactersAndLetters = /\w/; if(name.match(letters) !== null && name.match(legalCharactersAndLetters) || !name.match(numberAndSpecialCharacter)){ status = INVALID_IMAGE_NAME; } return status; }; /** * Call to the backend to the list of image categories * @param results */ self.loadCategories = function (results) { self.imageCategories = results; }; /** * Call to the backend to get the list of image sources * @param results */ self.loadSources = function (results) { self.imageSources = results; }; /** * Call to the backend to get the list of image destination domains * @param results */ self.loadDestinations = function (results) { self.destinationDomains = results; self.selectedDestinations = results; }; /** * Component will reload the kits data whenever the item is changed in casepack. */ this.$onChanges = function () { }; /**If there is an error this will display the error * @param error */ self.fetchError = function (error) { self.isWaiting = false; self.data = null; if (error && error.data) { if (error.data.message != null && error.data.message != EMPTY) { self.setError(error.data.message); } else { self.setError(error.data.error); } } else { self.setError("An unknown error occurred."); } }; /** * Sets the error * @param error */ self.setError = function (error) { self.error = error; }; /** * This method handles changes of changing an image candidates 'Set As Primary' status * @param index */ self.changePrimary = function (index) { self.imageData[index].setToShowOnSite = self.imageData[index].setToPrimary; if(!self.imageData[index].setToPrimary){ self.imageData[index].existingImage=null; } else { self.imageData[index].existingImage = self.existingPrimaryAction[0]; } if(self.imageData[index].setToPrimary !== self.primaryAllChecked){ self.primaryAllChecked = self.showOnSiteAllChecked = false; if(self.imageData[index].setToPrimary){ var allSelectedItems = true; angular.forEach(self.imageData, function(image){ if(!image.setToPrimary && self.isValidToChange(image)){ allSelectedItems = false; } }); self.primaryAllChecked = self.showOnSiteAllChecked = allSelectedItems; } } if(self.primaryAllChecked){ self.existingImageAction = self.existingPrimaryAction; self.existingImageHeader = self.existingImageAction[0]; }else{ self.existingImageHeader = null; } }; /** * This method handles changes of changing an image candidates 'Show On Site' status * @param index */ self.changeShowOnSite = function (index) { if(!self.imageData[index].setToShowOnSite){ self.imageData[index].existingImage = null; } else { self.imageData[index].existingImage = self.existingAlternateAction[0]; } if(self.imageData[index].setToShowOnSite !== self.showOnSiteAllChecked){ self.showOnSiteAllChecked = false; if(self.imageData[index].setToShowOnSite){ var allSelectedItems = true; angular.forEach(self.imageData, function(image){ if(!image.setToShowOnSite && self.isValidToChange(image)){ allSelectedItems = false; } }); self.showOnSiteAllChecked = allSelectedItems; } } if(self.showOnSiteAllChecked){ self.existingImageAction = self.existingAlternateAction; self.existingImageHeader = self.existingImageAction[0]; }else{ self.existingImageHeader = null; } }; /** * This method handles changes of changing an image candidates 'Set As Alternate' status * @param index */ self.changeAlternate = function (index) { if(self.imageData[index].setToAlternate !== self.alternateAllChecked){ self.alternateAllChecked = false; if(self.imageData[index].setToAlternate){ var allSelectedItems = true; angular.forEach(self.imageData, function(image){ if(!image.setToAlternate && self.isValidToChange(image)){ allSelectedItems = false; } }); self.alternateAllChecked = allSelectedItems; } } if(!self.imageData[index].setToAlternate){ self.imageData[index].setToShowOnSite = false; self.showOnSiteAllChecked = self.alternateAllChecked; self.imageData[index].existingImage = null; }else if(self.imageData[index].setToShowOnSite){ self.imageData[index].existingImage = self.existingAlternateAction[0]; } if(self.alternateAllChecked && self.showOnSiteAllChecked){ self.existingImageHeader = self.existingImageAction[0]; }else{ self.existingImageHeader = null; } }; /** * This method handles the users request to remove an image form the list * @param index */ self.removeImage = function (index) { if(angular.equals(self.imageData[index].statusUpload , UPLOAD_SUCCESS_MESSAGE)){ self.totalSuccessfullyUploaded--; }else if(angular.equals(self.imageData[index].statusUpload , UPLOAD_FAILED_MESSAGE)){ self.totalFailedUploaded--; } self.imageData.splice(index, 1); self.resetImageDataTable(); if(self.imageData != null && self.imageData.length > 0){ var imageArray = []; angular.forEach(self.imageData, function(image){ if(self.isValidToChange(image)){ imageArray.push(image); } }); if(imageArray != null && imageArray.length > 0){ var allSelectedPrimary = true; var allSelectedAlternate = true; var allSelectedShowOnSite = true; var allSelectedItems = true; angular.forEach(imageArray, function(image){ if(!image.setToPrimary){ allSelectedPrimary = false; } if(!image.setToAlternate){ allSelectedAlternate = false; } if(!image.toUpload){ allSelectedItems = false; } if(!image.setToShowOnSite){ allSelectedShowOnSite = false; } }); self.primaryAllChecked = allSelectedPrimary; self.alternateAllChecked = allSelectedAlternate; self.showOnSiteAllChecked = allSelectedShowOnSite; self.uploadAllChecked = allSelectedItems; } }else{ self.primaryAllChecked = false; self.uploadAllChecked = false; self.alternateAllChecked = false; self.showOnSiteAllChecked = false; self.existingImageHeader = null; } self.getImagesUploadedToExport(); }; /** * This method removes all images from the image candidate table */ self.clearList = function () { self.resetCountImages(); self.imageData = []; self.existingImageHeader = null; self.updateImageDataTable(); }; /** * This method makes all the calls to refresh the image candidate table */ self.updateImageDataTable = function () { self.uploadAllChecked = false; //self.existingImageHeader = self.existingAlternateAction[0];; if(self.imageData.length == 0){ self.primaryAllChecked=false; self.showOnSiteAllChecked=false; self.alternateAllChecked=false; } self.tableParams.total(self.imageData.length); self.tableParams.count(self.imageData.length); self.tableParams.reload(); }; /** * This method makes all the calls to reset the image candidate table */ self.resetImageDataTable = function () { self.tableParams.total(self.imageData.length); self.tableParams.count(self.imageData.length); self.tableParams.reload(); }; /** * Reset variables count image. */ self.resetCountImages = function () { self.totalCurrentSelectedImages = 0; self.countUploadProcess = 0; self.totalSuccessfullyUploaded = 0; self.totalFailedUploaded = 0; }; /** * This method starts the image upload process */ self.startUploads = function () { self.imagesUploadedToExport = []; self.countUploadProcess = 0; self.totalCurrentSelectedImages = _.pluck(_.filter(self.imageData, function(o){ return o.toUpload == true;}),'toUpload').length; if(self.validateRequireFields()){ self.continueUploads = true; self.uploadImages(START_INDEX); } else { $('#confirmBeforeUploadModal').modal("show"); } }; /** * This method will signal the api to stop uploading images */ self.stopUploads = function () { self.continueUploads = false; for (var index = 0; index < self.imageData.length; index++) { if(index != self.getCurrentIndex){ if(self.imageData[index].toUpload === true){ self.totalFailedUploaded++; if(angular.equals(self.imageData[index].statusUpload , UPLOAD_FAILED_MESSAGE)){ self.totalFailedUploaded--; } self.imageData[index].statusUpload = UPLOAD_FAILED_MESSAGE; self.imageData[index].isUploading = false; self.imageData[index].toUpload = true; self.imageData[index].status = UPLOAD_NOT_SUCCESSFUL; } } } }; /** * This method tests to see if the user still wants to upload an image, then checks the current image is valid * to upload, for that to happen it needs to have an empty status and not already been uploaded * @param index */ self.uploadImages = function (index) { if(index<self.imageData.length && self.continueUploads){ self.isUploading = true; $rootScope.isStillUploadImage = true; if (self.imageData[index].toUpload) { self.imageData[index].status = self.validateImage(self.imageData[index]); if (angular.equals(EMPTY, self.imageData[index].status) && angular.equals(null, self.imageData[index].success)) { var existingImage = null; if (self.imageData[index].existingImage !== null) { existingImage = self.imageData[index].existingImage.keyword; } var upc = EMPTY; if(self.imageData[index].name.match(/_/) !== null){ upc=Number(self.imageData[index].name.split('_')[0]); } else{ upc=Number(self.imageData[index].name.split('.')[0]); } var imageToUpload = { upc: upc, imageCategoryCode: self.imageCategory.id, imageSourceCode: self.imageSource.id, imageName: self.imageData[index].name, destinationList: self.imageData[index].destinationDomain, imageData: self.imageData[index].data, primary: self.imageData[index].setToPrimary, alternate: self.imageData[index].setToAlternate, showOnSite: self.imageData[index].setToShowOnSite, existingImage: existingImage, }; self.imageData[index].isUploading = true; if(angular.equals(self.imageData[index].statusUpload , UPLOAD_FAILED_MESSAGE)){ self.totalFailedUploaded--; } self.getCurrentIndex = index; homeApi.search(self.initializeVarSearchAndFormatImageName(self.imageData[index]), function(results){ if(results.complete && results.recordCount == 0 ){ self.countUploadProcess++; self.totalFailedUploaded++; self.uploadAllChecked = false; self.imageData[index].statusUpload = UPLOAD_FAILED_MESSAGE; self.imageData[index].isUploading = false; self.imageData[index].toUpload = false; self.imageData[index].status = UPLOAD_NOT_SUCCESSFUL; self.uploadImages(++index); }else if(results.complete && results.recordCount > 0){ self.uploadSingleImage(imageToUpload, index); } }, function (error) { self.countUploadProcess++; self.totalFailedUploaded++; self.imageData[index].statusUpload = UPLOAD_FAILED_MESSAGE; self.imageData[index].isUploading = false; self.imageData[index].toUpload = true; self.imageData[index].status = UPLOAD_NOT_SUCCESSFUL; self.uploadImages(++index); }); } else { self.uploadImages(++index); } } else { self.uploadImages(++index); } } else { self.getImagesUploadedToExport(); $rootScope.isStillUploadImage = false; self.isUploading = false; } }; /** * This method to get the images upload to export. */ self.getImagesUploadedToExport = function(){ self.imagesUploadedToExport = []; for(var m = 0 ; m < self.imageData.length ; m++){ if(self.imageData[m].statusUpload !== undefined){ self.imageUpload = {}; self.imageUpload.imageName = self.imageData[m].name; self.imageUpload.imageFileSize = self.imageData[m].size; self.imageUpload.result = self.imageData[m].success !== null ? SUCCESSFUL : "X"; self.imageUpload.statusText = self.imageData[m].success !== null ? UPLOAD_SUCCESS_MESSAGE : self.imageData[m].status; self.imagesUploadedToExport.push(self.imageUpload); } } }; /** * This method to check the image meets specifications or not. * @param index */ self.checkTheImageMeetSpecificationsOrNot = function(index){ var upc = EMPTY ; if(self.imageData[index].name.match(/_/) !== null){ upc=Number(self.imageData[index].name.split('_')[0]); } else{ upc=Number(self.imageData[index].name.split('.')[0]); } productSellingUnitsApi.checkImageValid({upc : upc} , function (results) { if(results.data == true){ self.imageData[index].statusUpload = UPLOAD_SUCCESS_MESSAGE; self.totalSuccessfullyUploaded++; self.imageData[index].isUploading = false; self.imageData[index].toUpload = false; self.imageData[index].success = UPLOAD_SUCCESS_MESSAGE; self.uploadAllChecked = false; self.uploadImages(++index); }else{ self.totalSuccessfullyUploaded++; self.imageData[index].statusUpload = UPLOAD_SUCCESS_MESSAGE; self.imageData[index].isUploading = false; self.imageData[index].toUpload = false; self.imageData[index].status = DOES_NOT_MEET_CRITERIA; self.updateImageDataTable(); self.uploadImages(++index); } }); }; /** * This method to handle when upload alternate image fail. * @param index */ self.uploadAlternateAndShowOnSiteImageFail = function(index){ self.totalFailedUploaded++; self.imageData[index].statusUpload = UPLOAD_FAILED_MESSAGE; self.imageData[index].status = UPLOAD_ALTERNATE_WITHOUT_PRIMARY_IMAGE; self.imageData[index].isUploading = false; self.imageData[index].toUpload = false; self.uploadAllChecked = false; self.uploadImages(++index); }; /** * This method makes the call to the api and handles the response. * @param image * @param index */ self.uploadSingleImage=function(image, index){ self.countUploadProcess ++; productSellingUnitsApi.uploadImage(image, function(results){ //In the case upload alternate and show on site image without primary image if(results.message==""){ self.uploadAlternateAndShowOnSiteImageFail(index); }else{ self.checkTheImageMeetSpecificationsOrNot(index); } }, function (error) { self.totalFailedUploaded++; self.imageData[index].statusUpload = UPLOAD_FAILED_MESSAGE; self.imageData[index].isUploading = false; if (error && error.data) { if (error.data.message != null && error.data.message != EMPTY) { self.imageData[index].status = error.data.message; } else { self.imageData[index].status = error.data.error; } } else { self.imageData[index].status = "An unknown error occurred."; } self.updateImageDataTable(); self.uploadImages(++index); }); }; /** * This method ensures that all of the fields are populated before uploading * @param image * @returns {string} */ self.validateImage = function (image) { var status = EMPTY; if(self.imageCategory === null){ status += "Missing Image Category\n"; } if(self.imageSources === null){ status += "Missing Image Source\n"; } if(image.setToPrimary){ if(image.existingImage === null){ status += "Missing Existing Primary Action" } } return status; }; /** * This method will check all rows */ self.checkAllRows= function (columnNumber) { if(columnNumber === 1){ for(var index=0; index<self.imageData.length; index++){ if(self.isValidToChange(self.imageData[index])){ self.imageData[index].toUpload=self.uploadAllChecked; } } } //when user check or uncheck on show on site header check box else if(columnNumber === 4){ if(self.showOnSiteAllChecked){ self.existingImageAction = self.existingAlternateAction; self.existingImageHeader = self.existingImageAction[0]; }else{ self.existingImageHeader = null; } for(var index=0; index<self.imageData.length; index++){ if(self.isValidToChange(self.imageData[index])) { self.imageData[index].setToShowOnSite = self.showOnSiteAllChecked; if (self.showOnSiteAllChecked && self.alternateAllChecked) { self.imageData[index].existingImage = self.existingImageHeader; } else { self.imageData[index].existingImage = null; } } } } //when user check or uncheck on set as primary header check box else if(columnNumber === 5){ if (self.primaryAllChecked){ self.existingImageAction = self.existingPrimaryAction; self.existingImageHeader = self.existingImageAction[0]; }else{ self.existingImageHeader = null; } self.showOnSiteAllChecked = self.primaryAllChecked; for(var index=0; index<self.imageData.length; index++){ if(self.isValidToChange(self.imageData[index])) { self.imageData[index].setToPrimary = self.primaryAllChecked; self.imageData[index].setToShowOnSite = self.primaryAllChecked; if (self.primaryAllChecked) { self.imageData[index].existingImage = self.existingImageHeader; self.imageData[index].setToAlternate = false; } else { self.imageData[index].existingImage = null; } } } } //when user check or uncheck on set as alternate header check box else if(columnNumber === 6){ if(!self.alternateAllChecked){ self.showOnSiteAllChecked = false; self.existingImageHeader = null; } for(var index=0; index<self.imageData.length; index++){ if(self.isValidToChange(self.imageData[index])) { self.imageData[index].setToAlternate = self.alternateAllChecked; if(!self.alternateAllChecked){ self.imageData[index].setToShowOnSite = false; self.imageData[index].existingImage = null; }else{ self.imageData[index].setToPrimary = false; } } } } else if(columnNumber === 7){ for(var index=0; index<self.imageData.length; index++){ if(self.isValidToChange(self.imageData[index])) { if (self.imageData[index].setToPrimary || (self.imageData[index].setToAlternate && self.imageData[index].setToShowOnSite)) { self.imageData[index].existingImage = self.existingImageHeader; } } } } }; /** * This method will handle changes to selecting an image to upload * @param index */ self.selectImageToUpload=function (index) { if(self.imageData[index].toUpload !== self.uploadAllChecked){ self.uploadAllChecked = false; if(self.imageData[index].toUpload){ var allSelectedItems = true; angular.forEach(self.imageData, function(image){ if(!image.toUpload && self.isValidToChange(image)){ allSelectedItems = false; } }); self.uploadAllChecked = allSelectedItems; } } }; /** * This method will confirm the image category and source are valid before allowing the user to press upload * @returns {boolean} */ self.validToUpload = function () { var isDisabled = true; if(self.imageSource !== null && self.imageCategory !== null && self.imageData.length > 0){ isDisabled = false; } return isDisabled; }; /** * Constructs the table that shows the report. */ self.buildTable = function() { self.tableParams = new ngTableParams({ page:1, count: self.imageData.length, }, { counts:[], total: self.imageData.length, getData: function ($defer, params) { self.data = self.imageData; $defer.resolve(self.data); } } ); }; /** * This function will take all of the selected images and update their destination domains. */ self.massFill = function () { angular.forEach(self.imageData, function(image){ if(image.toUpload && self.isValidToChange(image)){ image.destinationDomain = self.selectedDestinations } }); }; /** * This method will check to see if the image is currently available to make changes to. */ self.isValidToChange = function (image) { if(image.status !== EMPTY || image.success != null){ return false; } else { return true; } }; self.isHeaderEnable = function () { for(var index = 0; index<self.imageData.length; index++){ if(self.imageData[index].statusUpload == undefined && !angular.equals(self.imageData[index].status ,INVALID_IMAGE_NAME)){ return true; } } return false }; self.isHeaderAlternateEnable = function () { for(var index = 0; index < self.imageData.length; index++){ if(self.imageData[index].setToPrimary && self.isValidToChange(self.imageData[index])){ return false; } } return true; } self.isHeaderPrimaryEnable = function () { for(var index = 0; index < self.imageData.length; index++){ if(self.imageData[index].setToAlternate && self.isValidToChange(self.imageData[index])){ return false; } } return true; }; /** * Check Destination * * @returns {boolean} */ self.validateDestination = function () { var flag = true; for (var i = 0; i <self.imageData.length;i++) { if (self.imageData[i].destinationDomain.length===0){ flag = false; break; } } return flag; }; /** * Handle on change category. */ self.onChangeCategory = function () { if (self.imageData !== null && self.imageData.length > 0 && self.imageCategory !== null &&self.imageCategory.id===self.CATEGORY_SWATCHES) { self.primaryAllChecked = false; angular.forEach(self.imageData, function(image){ image.setToPrimary = false; }); } }; /** * Check when user not chose destination or alternate or primary flag * * @returns {boolean} */ self.validateRequireFields = function () { var flag = true; for (var i = 0; i <self.imageData.length;i++) { if (self.imageData[i].toUpload && self.imageData[i].destinationDomain.length===0){ flag = false; self.MESSAGE_CONFIRM = self.MESSAGE_NO_DESTINATION_SELECTED; break; } if (self.imageData[i].toUpload && !self.imageData[i].setToAlternate && !self.imageData[i].setToPrimary){ flag = false; self.MESSAGE_CONFIRM = self.MESSAGE_NO_PRIMARY_OR_ALTERNATE_SELECTED; break; } } return flag; }; /** * This method will show existing image header dropdown. * @returns {boolean} */ self.showExistingImageHeader = function () { return (self.imageData != null && self.imageData.length > 0); }; } })();
/** * @param {string} name * @param {string} typed * @return {boolean} */ var isLongPressedName = function(name, typed) { if (name === typed) return true; let typedArr = typed.split(''); for (let i = 0; i < name.length; i++) { let typedLetterCount = 0; while (name[i] === typedArr[0]) { typedLetterCount++; typedArr.splice(0, 1); if (typedLetterCount === 1 && name[i] === name[i+1]) break; } if (typedLetterCount === 0) return false; } return typedArr.length ? false : true; };
import React from 'react'; import AppRouter from './routers/AppRouter'; const HeroesApp = () => { return ( // <div> // <h1>Heroes App</h1> // </div> // Agregamos el AppRouter que contiene el navbar desde el componente que creamos // Probamos que funcione // En el caso de login no debería presentar la barra ya que la idea es que la barra se presente luego de login // Creamos un nuevo componente de rutas DaskboardRoutes que manejará las rutas despues de loguear <AppRouter /> ) } export default HeroesApp;
var hill = require('./hill'); var jumper = require('./jumper'); var powerindicator = require('./powerindicator'); var input = require('./input'); var jumpState = require('./jumpstate'); var Vector = require('./vector'); var viewPort = require('./viewport'); hill.load(require('../data/holmenkollen.json')); exports = module.exports = { entities: [], enter: function() { this.entities = [hill, jumper, powerindicator]; input.down(32, function() { jumpState.jumpPower++; }); input.up(32, function() { jumpState.finalJumpPower = jumpState.jumpPower; jumpState.jumpPower = 0; }); }, render: function(ctx) { for (var i = this.entities.length; i--;) this.entities[i].render(ctx); }, update: function(time, delta) { if (input.isDown(87)) viewPort.offsetY += 20; // W if (input.isDown(83)) viewPort.offsetY -= 20; // S if (input.isDown(65)) viewPort.offsetX += 20; // A if (input.isDown(68)) viewPort.offsetX -= 20; // D if (input.isDown(81)) viewPort.scale += 0.01; // Q if (input.isDown(69)) viewPort.scale -= 0.01; // E for (var i = this.entities.length; i--;) this.entities[i].update(time, delta); }, leave: function() {} };
jQuery( document ).ready( function() { jQuery('.form-group.exchangetypeoffering').appendTo('#step1 .panel-body'); jQuery('.form-group.carecalendaravailable').appendTo('#step1 .panel-body'); jQuery('.form-group.lastminutecareavailable').appendTo('#step1 .panel-body'); jQuery('.form-group.specialneedsoffering').appendTo('#step1 .panel-body'); jQuery('.form-group.experience').appendTo('#step1 .panel-body'); jQuery('.form-group.numberofexchanges').appendTo('#step1 .panel-body'); jQuery('.form-group.references').appendTo('#step1 .panel-body'); jQuery('.form-group.willingtosharephotoid').appendTo('#step1 .panel-body'); jQuery('.form-group.havepolicerecordcheck').appendTo('#step1 .panel-body'); jQuery('.form-group.facebook').appendTo('#step1 .panel-body'); jQuery('.form-group.linkedin').appendTo('#step1 .panel-body'); jQuery('.form-group.twitter').appendTo('#step1 .panel-body'); jQuery('.form-group.website').appendTo('#step1 .panel-body'); jQuery('.form-group.phone').appendTo('#step1 .panel-body'); jQuery('.form-group.neighbourhood').appendTo('#step1 .panel-body'); jQuery('#t1 tr.cpm-category').insertBefore('#t1 tr.rowwexchangetypeoffering'); jQuery('#t1 tr.rowwneighbourhood').insertAfter('#t1 tr.cpm-state') jQuery('#usernamefieldd').autocomplete({ source: function( name, response) { // console.log(name.term); jQuery.ajax({ type: 'POST', dataType: 'json', url: ajaxurl, data: { action: 'get_user_lists', hint: name.term }, success: function(data) { response(data); } }); } }); jQuery('form#cpm-sendmsgform').on( 'submit', function() { var username = jQuery('input#usernamefieldd').val(); var message = jQuery('[name="cpm_message"]').val(); jQuery.ajax({ type: 'POST', url: ajaxurl, dataType: 'json', data: { action: 'send_testimonial_request', username: username, message: message }, success: function(data) { console.log(data.showmesgbox); if ( data.showmesgbox ) { jQuery('#cpm-msgAjax').text(data.error_message); } var modal = document.getElementById('myModal'); var span = document.getElementsByClassName("close")[0]; span.onclick = function() { modal.style.display = "none"; jQuery('body').css( 'overflow', 'scroll'); } // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; jQuery('body').css( 'overflow', 'scroll'); } } } }); return false; }); // jQuery('#wlt_stepswizard').on('shown.bs.collapse', function (e) { // var selected = jQuery(this); // var collapseh = jQuery(".collapse .in").height(); // jQuery.scrollTo(selected, 500, { // offset: -(collapseh) // }); // }); });
function greet(callback) { console.log('Hello'); callback(); } greet(function(){ console.log("I'm the callback"); }); // var fs = require('fs'); // var greeting = fs.readFile(__dirname + '/greet.txt', 'utf8', function(err, data) { // console.log(data) // });
import React, { Component } from "react"; import { Stage, Layer, Rect, Text, Group, Image } from "react-konva"; import JsBarcode from "jsbarcode"; import { Button } from "@material-ui/core"; const NoSim = ({ x, y, content }) => ( <Group x={x} y={y}> <Text x={85} text={content} fontSize={9} fontStyle="bold" fontFamily="Roboto" /> </Group> ); const Nama = ({ y, content }) => ( <Group y={y}> <Text text="Nama" fontSize={9} fontFamily="Roboto" fontStyle="bold" /> <Text x={85} text=":" fontSize={9} fontFamily="Roboto" fontStyle="bold" /> <Text x={90} text={content} fontSize={9} fontFamily="Roboto" fontStyle="bold" /> </Group> ); const TempatTanggalLahir = ({ y, content }) => ( <Group y={y}> <Text text="Tempat/Tgl. Lahir" fontSize={9} fontFamily="Roboto" fontStyle="bold" /> <Text x={85} text=":" fontSize={9} fontFamily="Roboto" fontStyle="bold" /> <Text x={90} text={content} fontSize={9} fontFamily="Roboto" fontStyle="bold" /> </Group> ); const PangkatKorpsNrpNip = ({ y, content }) => ( <Group y={y}> <Text text="Pangkat/NRP/NIP" fontSize={9} fontFamily="Roboto" fontStyle="bold" /> <Text x={85} text=":" fontSize={9} fontFamily="Roboto" fontStyle="bold" /> <Text x={90} text={content} fontSize={9} fontFamily="Roboto" fontStyle="bold" /> </Group> ); const Kesatuan = ({ y, content }) => ( <Group y={y}> <Text text="Kesatuan" fontSize={9} fontFamily="Roboto" fontStyle="bold" /> <Text x={85} text=":" fontSize={9} fontFamily="Roboto" fontStyle="bold" /> <Text x={90} text={content} fontSize={9} fontFamily="Roboto" fontStyle="bold" /> </Group> ); const GolonganDarah = ({ y, content }) => ( <Group y={y}> <Text text="Golongan darah" fontSize={9} fontFamily="Roboto" fontStyle="bold" /> <Text x={85} text=":" fontSize={9} fontFamily="Roboto" fontStyle="bold" /> <Text x={90} text={content} fontSize={9} fontFamily="Roboto" fontStyle="bold" /> </Group> ); const DiberikanDi = ({ y, content }) => ( <Group y={y}> <Text text="Diberikan di" fontSize={9} fontFamily="Roboto" fontStyle="bold" /> <Text x={70} text=":" fontSize={9} fontFamily="Roboto" fontStyle="bold" /> <Text x={75} text={content} fontSize={9} fontFamily="Roboto" fontStyle="bold" /> </Group> ); const PadaTanggal = ({ y, content }) => ( <Group y={y}> <Text text="Pada tanggal" fontSize={9} fontFamily="Roboto" fontStyle="bold" /> <Text x={70} text=":" fontSize={9} fontFamily="Roboto" fontStyle="bold" /> <Text x={75} text={content} fontSize={9} fontFamily="Roboto" fontStyle="bold" /> </Group> ); const BerlakuHingga = ({ y, content }) => ( <Group y={y}> <Text text="Berlaku hingga" fontSize={9} fontFamily="Roboto" fontStyle="bold" /> <Text x={70} text=":" fontSize={9} fontFamily="Roboto" fontStyle="bold" /> <Text x={75} text={content} fontSize={9} fontFamily="Roboto" fontStyle="bold" /> </Group> ); const LabelKomandan = ({ y, content }) => ( <Group y={y}> <Text text={content} fontSize={9} fontFamily="Roboto" fontStyle="bold" /> </Group> ); const NamaKomandan = ({ y, content }) => ( <Group y={y}> <Text text={content} fontSize={9} fontFamily="Roboto" fontStyle="bold" /> </Group> ); const PangkatKorpsNrpKomandan = ({ y, content }) => ( <Group y={y}> <Text text={content} fontSize={9} fontFamily="Roboto" fontStyle="bold" /> </Group> ); const DataPribadi = ({ x, y, nama, tempat_tanggal_lahir, pangkat_korps_no_identitas, kesatuan, golongan_darah }) => ( <Group x={x} y={y}> <Nama y={0} content={nama}></Nama> <TempatTanggalLahir y={10} content={tempat_tanggal_lahir} /> <PangkatKorpsNrpNip y={20} content={pangkat_korps_no_identitas} /> <Kesatuan y={30} content={kesatuan} /> <GolonganDarah y={40} content={golongan_darah} /> </Group> ); const KeteranganSim = ({ x, y, diberikan_di, pada_tanggal, berlaku_hingga }) => ( <Group x={x} y={y}> <DiberikanDi y={0} content={diberikan_di} /> <PadaTanggal y={10} content={pada_tanggal} /> <BerlakuHingga y={20} content={berlaku_hingga} /> </Group> ); const Komandan = ({ x, y, label_komandan, nama_komandan, pangkat_korps_no_identitas_komandan }) => ( <Group x={x} y={y}> <LabelKomandan y={0} content={label_komandan} /> <NamaKomandan y={40} content={nama_komandan} /> <PangkatKorpsNrpKomandan y={50} content={pangkat_korps_no_identitas_komandan} /> </Group> ); class SimCanvas extends Component { state = {}; componentDidMount = () => { const { sim_id } = this.props; this.loadBarcode(sim_id); this.loadSignature(); this.loadSidikJari(); this.loadPasFoto(); this.loadTandaTanganKomandan(); this.loadStempel(); }; loadStempel = () => { const { stempel } = this.props; this.stempel = new window.Image(); this.stempel.src = stempel; this.stempel.addEventListener("load", this.handleLoadStempel); }; handleLoadStempel = () => { this.setState({ stempel: this.stempel }); }; loadTandaTanganKomandan = () => { const { tanda_tangan_komandan } = this.props; this.tanda_tangan_komandan = new window.Image(); this.tanda_tangan_komandan.src = tanda_tangan_komandan; this.tanda_tangan_komandan.addEventListener( "load", this.handleLoadTandaTanganKomandan ); }; handleLoadTandaTanganKomandan = () => { this.setState({ tanda_tangan_komandan: this.tanda_tangan_komandan }); }; loadPasFoto = () => { const { pas_foto } = this.props; this.pas_foto = new window.Image(); this.pas_foto.src = pas_foto; this.pas_foto.addEventListener("load", this.handleLoadPasFoto); }; handleLoadPasFoto = () => { this.setState({ pas_foto: this.pas_foto }); }; loadBarcode = no_urut_sim => { this.barcode = new window.Image(); JsBarcode(this.barcode, no_urut_sim, { background: "transparent", displayValue: false }); this.barcode.addEventListener("load", this.handleLoadBarcode); }; handleLoadBarcode = () => { this.setState({ barcode: this.barcode }); }; loadSignature = () => { const { tanda_tangan } = this.props; this.signature = new window.Image(); this.signature.src = tanda_tangan; this.signature.addEventListener("load", this.handleLoadSignature); }; handleLoadSignature = () => { this.setState({ signature: this.signature }); }; loadSidikJari = () => { const { sidik_jari } = this.props; this.sidik_jari = new window.Image(); this.sidik_jari.src = sidik_jari; this.sidik_jari.addEventListener("load", this.handleLoadSidikJari); }; handleLoadSidikJari = () => { this.setState({ sidik_jari: this.sidik_jari }); }; simpan = () => { const image = this.stageRef.toDataURL({ mimeType: "image/png", width: 325, height: 204, quality: 2, pixelRatio: 5 }); this.setState({ image }); }; render() { const { kode_sim, nama, tempat_tanggal_lahir, pangkat_korps_no_identitas, kesatuan, gol_darah, diberikan_di, pada_tanggal, berlaku_hingga, label_komandan, nama_komandan, pangkat_korps_no_identitas_komandan } = this.props; return ( <div> <img src={this.state.image} width={325} height={204}></img> <Stage width={325} height={204} ref={ref => (this.stageRef = ref)}> <Layer> <NoSim x={55} y={38} content={kode_sim} /> <DataPribadi x={10} y={55} nama={nama} tempat_tanggal_lahir={tempat_tanggal_lahir} pangkat_korps_no_identitas={pangkat_korps_no_identitas} kesatuan={kesatuan} golongan_darah={gol_darah} /> <KeteranganSim x={170} y={107} diberikan_di={diberikan_di} pada_tanggal={pada_tanggal} berlaku_hingga={berlaku_hingga} /> <Komandan x={230} y={140} label_komandan={label_komandan} nama_komandan={nama_komandan} pangkat_korps_no_identitas_komandan={ pangkat_korps_no_identitas_komandan } /> <Image x={88} y={107} image={this.state.pas_foto} width={75} height={90} ></Image> <Image x={160} y={147} image={this.state.tanda_tangan_komandan} width={200} height={40} ></Image> <Image x={175} y={135} image={this.state.stempel} width={60} height={60} ></Image> <Image x={10} y={177} width={70} height={20} image={this.state.barcode} ></Image> <Image x={10} y={105} image={this.state.sidik_jari} width={45} height={50} ></Image> <Image x={-25} y={150} width={150} height={30} image={this.state.signature} ></Image> </Layer> </Stage> <Button onClick={this.simpan}>Simpan</Button> </div> ); } } export default SimCanvas;
/* * Copyright (c) 2014 Vincent Petry <pvince81@owncloud.com> * * This file is licensed under the Affero General Public License version 3 * or later. * * See the COPYING-README file. * */ describe('OCA.Files.TagsPlugin tests', function() { var fileList; var testFiles; beforeEach(function() { var $content = $('<div id="content"></div>'); $('#testArea').append($content); // dummy file list var $div = $( '<div>' + '<table id="filestable">' + '<thead></thead>' + '<tbody id="fileList"></tbody>' + '</table>' + '</div>'); $('#content').append($div); fileList = new OCA.Files.FileList($div); OCA.Files.TagsPlugin.attach(fileList); testFiles = [{ id: 1, type: 'file', name: 'One.txt', path: '/subdir', mimetype: 'text/plain', size: 12, permissions: OC.PERMISSION_ALL, etag: 'abc', shareOwner: 'User One', isShareMountPoint: false, tags: ['tag1', 'tag2'] }]; }); afterEach(function() { fileList.destroy(); fileList = null; }); describe('Favorites icon', function() { it('renders favorite icon and extra data', function() { var $action, $tr; fileList.setFiles(testFiles); $tr = fileList.$el.find('tbody tr:first'); $action = $tr.find('.action-favorite'); expect($action.length).toEqual(1); expect($action.hasClass('permanent')).toEqual(false); expect($tr.attr('data-tags').split('|')).toEqual(['tag1', 'tag2']); expect($tr.attr('data-favorite')).not.toBeDefined(); }); it('renders permanent favorite icon and extra data', function() { var $action, $tr; testFiles[0].tags.push(OC.TAG_FAVORITE); fileList.setFiles(testFiles); $tr = fileList.$el.find('tbody tr:first'); $action = $tr.find('.action-favorite'); expect($action.length).toEqual(1); expect($action.hasClass('permanent')).toEqual(true); expect($tr.attr('data-tags').split('|')).toEqual(['tag1', 'tag2', OC.TAG_FAVORITE]); expect($tr.attr('data-favorite')).toEqual('true'); }); it('adds has-favorites class on table', function() { expect(fileList.$el.hasClass('has-favorites')).toEqual(true); }); }); describe('Applying tags', function() { it('sends request to server and updates icon', function() { var request; fileList.setFiles(testFiles); var $tr = fileList.findFileEl('One.txt'); var $action = $tr.find('.action-favorite'); $action.click(); expect(fakeServer.requests.length).toEqual(1); request = fakeServer.requests[0]; expect(JSON.parse(request.requestBody)).toEqual({ tags: ['tag1', 'tag2', OC.TAG_FAVORITE] }); request.respond(200, {'Content-Type': 'application/json'}, JSON.stringify({ tags: ['tag1', 'tag2', 'tag3', OC.TAG_FAVORITE] })); // re-read the element as it was re-inserted $tr = fileList.findFileEl('One.txt'); $action = $tr.find('.action-favorite'); expect($tr.attr('data-favorite')).toEqual('true'); expect($tr.attr('data-tags').split('|')).toEqual(['tag1', 'tag2', 'tag3', OC.TAG_FAVORITE]); expect(fileList.files[0].tags).toEqual(['tag1', 'tag2', 'tag3', OC.TAG_FAVORITE]); expect($action.find('.icon').hasClass('icon-star')).toEqual(false); expect($action.find('.icon').hasClass('icon-starred')).toEqual(true); $action.click(); expect(fakeServer.requests.length).toEqual(2); request = fakeServer.requests[1]; expect(JSON.parse(request.requestBody)).toEqual({ tags: ['tag1', 'tag2', 'tag3'] }); request.respond(200, {'Content-Type': 'application/json'}, JSON.stringify({ tags: ['tag1', 'tag2', 'tag3'] })); // re-read the element as it was re-inserted $tr = fileList.findFileEl('One.txt'); $action = $tr.find('.action-favorite'); expect($tr.attr('data-favorite')).toBeFalsy(); expect($tr.attr('data-tags').split('|')).toEqual(['tag1', 'tag2', 'tag3']); expect(fileList.files[0].tags).toEqual(['tag1', 'tag2', 'tag3']); expect($action.find('.icon').hasClass('icon-star')).toEqual(true); expect($action.find('.icon').hasClass('icon-starred')).toEqual(false); }); }); describe('elementToFile', function() { it('returns tags', function() { fileList.setFiles(testFiles); var $tr = fileList.findFileEl('One.txt'); var data = fileList.elementToFile($tr); expect(data.tags).toEqual(['tag1', 'tag2']); }); it('returns empty array when no tags present', function() { delete testFiles[0].tags; fileList.setFiles(testFiles); var $tr = fileList.findFileEl('One.txt'); var data = fileList.elementToFile($tr); expect(data.tags).toEqual([]); }); }); });
import React, { Component } from 'react'; import { BrowserRouter, Route, Switch, Redirect } from 'react-router-dom'; import { MuiThemeProvider } from '@material-ui/core/styles'; import AuthView from './containers/AuthView'; import EventsView from './containers/EventsView'; import { BookingsView } from './containers/BookingsView'; import AuthContext from './context/auth-context'; import Navbar from './components/Navbar/Navbar'; import CustomMuiTheme from './assets/theme/CustomMuiTheme'; export class App extends Component { state = { userId: undefined, token: undefined } login = (userId, token, tokenExpiration) => this.setState({ userId, token }); logout = () => this.setState({ userId: undefined, token: undefined }); renderRoutes = () => { if (this.state.token) { return ( <Switch> <Redirect from="/" to="/events" exact /> <Redirect from="/auth" to="/events" exact /> <Route path="/events" component={EventsView} /> <Route path="/bookings" component={BookingsView} /> </Switch> ); } return ( <Switch> <Redirect from="/" to="/auth" exact /> <Redirect from="/bookings" to="/auth" exact /> <Route path="/auth" component={AuthView} /> <Route path="/events" component={EventsView} /> </Switch> ); } render () { const { userId, token } = this.state; return ( <MuiThemeProvider theme={CustomMuiTheme}> <BrowserRouter> <React.Fragment> <AuthContext.Provider value={{ userId, token, login: this.login, logout: this.logout }} > <Navbar /> <main> {this.renderRoutes()} </main> </AuthContext.Provider> </React.Fragment> </BrowserRouter> </MuiThemeProvider> ); } }
import { connect } from 'react-redux'; import { getCurrentPrice, getPrices } from '../../actions/price_actions' import CoinSum from './coin_sum'; const mapStateToProps = (state, ownProps) => { return { user: state.entities.users[state.session.currentUser], coin: ownProps.match.params.coin, price: state.entities.prices }; }; const mapDispatchToProps = (dispatch, ownProps) => ({ fetchPrice: () => dispatch(getCurrentPrice()), fetchRange: duration => dispatch(getPrices(duration)) }); export default connect( mapStateToProps, mapDispatchToProps )(CoinSum);
/******************************************************************************** * drawTable() * * Populates table body of HTML with content in dataRows. * @param dataRows: array of database entries ********************************************************************************/ function drawTable(dataRows) { var mainBody = document.getElementById("mainBody"); mainBody.textContent = ""; var props = ["name", "reps", "weight", "date", "lbs", "id"]; // Add new row for each database entry for (var i = 0; i < dataRows.length; i++) { var row = document.createElement("tr"); var dataRow = dataRows[i]; var cell; // Add data cells for (var j = 0; j < props.length - 1; j++) { cell = document.createElement("td"); cell.textContent = dataRow[props[j]]; row.appendChild(cell); } // Add Delete button cell = document.createElement("td"); var delButton = document.createElement("button"); delButton.textContent = "Delete"; delButton.className = dataRow[props[props.length - 1]]; // className = id delButton.addEventListener("click", function(event){ // listen for delete event var req = new XMLHttpRequest(); var payload = {id: this.className}; req.open("POST", "/delete", true); req.setRequestHeader("Content-Type", "application/json"); req.addEventListener("load", function() { if (req.status >= 200 && req.status < 400) { var response = JSON.parse(req.responseText); drawTable(response); } else { console.log("Error in network request: " + req.statusText); } }); req.send(JSON.stringify(payload)); event.preventDefault(); }); cell.appendChild(delButton); row.appendChild(cell); // Add Edit button cell = document.createElement("td"); var editForm = document.createElement("form"); editForm.method = "GET"; editForm.action = "/edit"; var hidden = document.createElement("input"); hidden.type = "hidden"; hidden.name = "id"; hidden.value = dataRow[props[props.length - 1]]; editForm.appendChild(hidden); var editButton = document.createElement("input"); editButton.type = "submit"; editButton.name = "Edit"; editButton.value = "Edit"; editForm.appendChild(editButton); cell.appendChild(editForm); row.appendChild(cell); mainBody.appendChild(row); } } /******************************************************************************** * Populate table as soon as document loads ********************************************************************************/ document.addEventListener("DOMContentLoaded", function(event) { var req = new XMLHttpRequest(); req.open("GET", "/select-all", true); req.addEventListener("load", function() { if (req.status >= 200 && req.status < 400) { var response = JSON.parse(req.responseText); drawTable(response); } else { console.log("Error in network request: " + req.statusText); } }); req.send(null); }); /******************************************************************************** * Listen for addition of new exercise ********************************************************************************/ document.getElementById("addExercise").addEventListener("click", function(event) { var req = new XMLHttpRequest(); var exName = document.getElementById("exName").value; var exReps = document.getElementById("exReps").value; var exWeight = document.getElementById("exWeight").value; var exDate = document.getElementById("exDate").value; var exLbs = document.getElementById("exLbs").value; var payload = {name: exName, reps: exReps, weight: exWeight, date: exDate, lbs: exLbs}; req.open("POST", "/insert", true); req.setRequestHeader("Content-Type", "application/json"); req.addEventListener("load", function() { if (req.status >= 200 && req.status < 400) { var response = JSON.parse(req.responseText); drawTable(response); } else { console.log("Error in network request: " + req.statusText); } }); req.send(JSON.stringify(payload)); event.preventDefault(); });
import React, { Component } from 'react'; /** * This component renders any type of input field */ export default class BasicInput extends Component { render() { return ( <div className="BasicInput"> <label htmlFor={this.props.name}>{this.props.label}</label> <input id={this.props.name} type={this.props.type} placeholder={this.props.placeholder} /> </div> ); } }
// export default function carMake(model, make) { // let makeJeep = ` // <option id="modeljeep" value="Select Model">Select Model</option> // <option id="wrangler" value="Wrangler">Early Wrangler</option> // <option id="grandcherokee" value="grand cherokee">Grand Cherokee</option> // <option id="renegade" value="Renegade">Early Renegade</option> // <option id="compass" value="compass">Compass</option> // <option id="gladiator" value="gladiator">Gladiator</option> // <option id="cherokee" value="Cherokee">Cherokee</option> // `; // let makeVolkswagen = ` // <option id="modelvolkswagen" value="Select Model">Select Model</option> // <option id="golf" value="Golf">Golf</option> // <option id="passat" value="Passat">Passat</option> // <option id="beetle" value="Beetle">Beetle</option> // <option id="jetta" value="Jetta">Jetta</option> // <option id="tiguan" value="Tiguan">Tiguan</option> // <option id="atlas" value="Atlas">Atlas</option> // `; // let makeChrysler = ` // <option id="modelchrysler" value="Select Model">Select Model</option> // <option id="chryslernewyorker" value="Chrysler NewYorker">Chrysler NewYorker</option> // <option id="grandvoyager" value="Grand Voyager">Grand Voyager</option> // <option id="chrysler300" value="Chrysler 300">Chrysler 300</option> // <option id="chryslerpacifica" value="Chrysler Pacifica">Chrysler Pacifica</option> // <option id="chryslervoyager" value="Chrysler Voyager">Chrysler Voyager</option> // <option id="dodge" value="Dodge">Dodge</option> // `; // let makeGmc = ` // <option id="modelgmc" value="Select Model">Select Model</option> // <option id="yukon" value="Yukon">Yukon</option> // <option id="acadia" value="Acadia">Acadia</option> // <option id="terrain" value="Terrain">Terrain</option> // <option id="Canyon" value="Canyon">Canyon</option> // <option id="Sierra" value="Sierra">Sierra</option> // <option id="Savana"value="Savana">Savana</option> // `; // model.addEventListener("change", e => { // if (model.value === "GMC") { // make.innerHTML = makeGmc; // } // if (model.value === "Chrysler") { // make.innerHTML = makeChrysler; // } // if (model.value === "Volkswagen") { // make.innerHTML = makeVolkswagen; // } // if (model.value === "Jeep") { // make.innerHTML = makeJeep; // } // }); // }
// 日语 const JP = { header: { text1: '登録', text2: '新規取得', text3: '取引Quin', text4: 'Quin:実体資産と暗号世界との架橋', newsList: [ { text: '1.李嘉诚出手!拿下伦敦瑞银UBS大楼,收租金融城地标', show: true }, { text: '2.Q.Arthur将首发1亿英镑Quin币', show: true }, { text: '3.数字货币+金融地产加速布局全球投资领域 各大资本强力加持Quin', show: true } ], navList: [ { name: 'Q.Arthur', path: '/home', dropDownFlag: false, dropDown: [ { name: 'Quinインフレ対策属性', anchor: 'Aarea' }, { name: 'Quin資産収益率', anchor: 'Barea' }, { name: 'Quin广泛参与性', anchor: 'Carea' }, { name: 'Quin資産流動性', anchor: 'Earea' }, { name: 'Quinのプレミアムの余地', anchor: 'Farea' }, { name: 'Quinの保障体系', anchor: 'Garea' }, { name: '流通しているイングラン銀行', anchor: 'Darea' } ] }, { name: 'Quin百科', path: '/wiki', dropDownFlag: false, dropDown: [ { name: 'Quin紹介', anchor: 'dropIntroduction', top: 15, childer: [ { name: '1.1 第一期発行の価額', anchor: 'childPrice', top: 55 }, { name: '1.2 第一期の発行規模', anchor: 'childScale', top: 89 }, { name: '1.3 Quinの構造図', anchor: 'childStructure', top: 123 } ] }, { name: 'Quinの設計理念', anchor: 'dropPhilosophy', top: 157, childer: [ { name: '2.1 価値保全', anchor: 'childValue', top: 197 }, { name: '2.2 資金流動', anchor: 'childFlow', top: 231 }, { name: '2.3 投資者に対する優勢', anchor: 'childAdvantages', top: 265 } ] }, { name: '資産の組合せと資産の選択', anchor: 'dropAsset', top: 299, childer: [ { name: '3.1 資産の選択', anchor: 'childSelect', top: 339 }, { name: '3.2 不動産の主要な投資スタイルと営利モード', anchor: 'childInvesting', top: 373 }, { name: '3.3 商業不動産のキャッシュフローの構成', anchor: 'childCash', top: 407 }, { name: '3.4 シティ・オブ・ロンドン', anchor: 'childCity', top: 441 }, { name: '3.5 Quinの長期的目標', anchor: 'childGoal', top: 475 } ] }, { name: '業績評価と分配', anchor: 'dropPerformance', top: 509, childer: [ { name: '4.1 分配フロー図', anchor: 'childDistribution', top: 549 }, { name: '4.2 事例説明', anchor: 'childCase', top: 583 } ] }, { name: 'Quinの共同認識メカニズム', anchor: 'dropConsensus', top: 617, childer: [ { name: '5.1 Quinのビジョン', anchor: 'childVision', top: 657 }, { name: '5.2 メインチェーン&サイドチェーンのモード', anchor: 'childMain', top: 691 } ] } ] }, { name: '資産裏書', path: '/strategy/assetRecite' }, { name: '動態', path: '/newView', dropDownFlag: false }, { name: '我々について', path: '/about', dropDownFlag: false, dropDown: [ {name: '我々の使命', anchor: 'aaa'}, {name: '我々の理念', anchor: 'bbb'}, {name: '先陣と創新者', anchor: 'ccc'} ] } ] }, home: { text1: 'リアルな世界と、暗号化世界の架け橋', text2: 'Quin、世界中でも最もコアとなる資産の裏書をする分散化暗号通貨', text3: 'シティ・オブ・ロンドン、ヨーロッパをにおいて悠久たる歴史を持つ金融センター。不動産の賃借人となる銀行や保険、大型ヘッジファンドなどトップな機関が集結しています。シティ・オブ・ロンドンにて資産を所有する当社のQuinに投資することは、シティ・オブ・ロンドンという世界の絶対的な中心地の商業用不動産を所有するのと同然。', text4: '銀行預金よりも安全の割には、銀行の金利をはるかに上回っています!', text5: 'Quinの裏書き資産はシーズンごとに当社の利益を踏まえた5%+50%の予定額以上の分配が行われます。Quinにインフレ回避の効果もあるため、資産の資産縮小から守ってくれます。ブロックチェーン技術によるQuinの信頼できるセキュリティ性のおかげで、Quinを所有することは銀行以上に安全です。銀行に倒産の可能性がありますが、Quinは決してそうにはなりません。', text6: '不動産所有よりもQuin所有の方は流動性が高い', text7: 'Quin所有は、不動産所有と同然です。不動産取引に取り組む長期的な投資プロジェクトであるQuinは、ワールドワイドで100以上のブロックチェーンデジタル通貨取引プラットフォームが点在、いつでも取引サービスをご提供します。', text8: '資産の裏書きのない他の通貨と比べ、Quinの信頼性が高い', text9: '暗号通貨の中でも「ステーブルコイン」とされるQuin。ステーブルコインとは、暗号化市場において最も安定したトークンの一つです。要するに、資産「裏書き」や「支え」となるトークンを持つということなので、他の暗号通貨と比べ、価格変動がより小さいのです。', text10: 'Quinにより元々少人数のゲームに参加することができる', text11: '金融食物連鎖トップの資産、ブロックチェーン技術により、一般者も参加できるようになり、資本に追われる快感を享受する', text12: '力強くサポートしてくれる法令や会計監査', text13: '世界トップな法律事務所よりQuinと資産とのバインドを約束してくれます。プライスウォーターハウスクーパースによって資産の安全性や透明性が確保されます。', text14: '「この地球では、一番良い投資先は地球そのものだ。」', text15: 'アメリカの名不動産投資家-ルイ・グリックマンより(Louis J. Glickman)', text16: 'グローバルで従来の上質な資産の安全性をベースに、新ブロックチェーン技術を生かして、お客様の資産を守るよう取り組んでおり、旧経済を新経済につなげて新たな資産の世界を再構築したいと思います。', text17: 'FAQ', text21: 'language' }, wike: { imgUrl: { img1: require('../../assets/images/wiki/en/1.2_en.svg'), img2: require('../../assets/images/wiki/en/1.3_en.svg'), img3: require('../../assets/images/wiki/en/2.2_en.svg'), img4: require('../../assets/images/wiki/en/3.1_en.svg'), img5: require('../../assets/images/wiki/en/3.3_en.svg'), img6: require('../../assets/images/wiki/en/4.1_en.svg'), img7: require('../../assets/images/wiki/en/5.2-3_en.svg'), img8: require('../../assets/images/wiki/5.2-3_en.svg') }, childAdvantages: [ { text: '資産に対してインフレ対策の属性を持ち、安全、収益が高く、且つ伝統的な金融手段を利用し倍の報いを得ることが出来る。' }, { text: '代用硬貨は国という制限を超え、資産の流動性がさらに強い。' }, { text: 'そのほか資産裏書のない暗号数字硬貨がマーケット上に置いての価額の状況を参考にし、資産裏書ありの暗号数字硬貨の値上げ空間は巨大である。' }, { text: 'グローバルで最高標準認可の上質な資産を後ろ盾とし、消費者価額指数ヘッジの資産組合せを形成する。' }, { text: '原価効益の最適な選択として、企業と個人のお手伝いし、その富のグローバル配置を実現させ、グローバル獲得とグローバル支払い。' }, { text: '代用硬貨の額分の投資と請戻し面において便利性、持続可能性と安全性を実現し、伝統な資産数字化後の核心優勢を表した。' }, { text: '資産管理チームはシティ・オブ・ロンドンの核心地域に所在しているため、上質資産がマーケットに押し出す第一時間に反応を出すことができ、最適な価額と最低な財務原価で投資収益を拡大させることができる。' } ], dropAsset: [ { text: '投資者に対して「オールウエザー」の解決案を提供し、長期安定且つ収入収益を通じ収益を実現させる。収入型投資の策略指導下の核心地理位置の商業不動産はこの要求に満たしている。', img: require('../../assets/images/wiki/3-1.svg') }, { text: '収入型策略は比較的高いと持続可能な収入源を提供しており、同時に高品質と分散化を実行させることができる。本策略は現在の収入を最大化にし主要目標として、同時に全体の報いを強調している。本策略は全体報いを追求する積極管理スタイルと分配可能な収入の数字化技術を有機結合させることができる。', img: require('../../assets/images/wiki/3-2.svg') } ], childInvesting: [ { img: require('../../assets/images/wiki/3.2-1.svg'), title: '核心型', text: '主にオフィスビル、及び若干な安定キャッシュフローを有すサービス型アパート' }, { img: require('../../assets/images/wiki/3.2-2.svg'), title: '核心增益型', text: '主にデパートと百貨店' }, { img: require('../../assets/images/wiki/3.2-3.svg'), title: '增值型', text: '主に開発類プロジェクト、例えば町の更新、古いビルの改造、工業用地をビジネス用地に転換する開発等' }, { img: require('../../assets/images/wiki/3.2-4.svg'), title: 'チャンス型 ', text: '不良資産の買収を主とする' } ], childGoal: [ { text: '不動産', img: require('../../assets/images/wiki/3.5-1.svg') }, { text: 'エネルギー', img: require('../../assets/images/wiki/3.5-2.svg') }, { text: '農業', img: require('../../assets/images/wiki/3.5-3.svg') }, { text: '医療', img: require('../../assets/images/wiki/3.5-4.svg') }, { text: '教育', img: require('../../assets/images/wiki/3.5-5.svg') }, { text: '交通', img: require('../../assets/images/wiki/3.5-6.svg') } ], childCase: [ { text: '第一四半期: 本基金は1,500,000 ユーロの配当金を支払う(1.5%); これによりその自身は148万Quinを買い戻しすることが出来、則ち98,520,000 代用硬貨 100,000,000 ユーロの資産純価値対応(£1.015022/代用硬貨)' }, { text: '第二四半期: 本基金は1,500,000 ユーロの配当金を支払う(1.5%); それにより147万Quinを買い戻しすることが出来、即ち97,050,000 代用硬貨 100,000,000 ユーロの資産純価値対応 (£1.030397/代用硬貨)' } ], childMain: [ { text: '1、データブロックに対して、順序に従い、第一段Hashを建てる' }, { text: '2、第一段が各二つの順序にHash、第二段Hashを建てる ' }, { text: '3、各8個のブロック(2のn乗、配置可)になり、一つのトップ段を建てる Top Hash' }, { text: '4、各Top Hash、メインチェーンの取引に書き込む' }, { text: '5、ここまで、全ての節目は本サイドチェーンのある指定ブロックのロット取引を検証すること出来る' } ], text1: 'デジタル通過一枚で、新たな世界観がひらめく', text2: 'グルーバルポートフォリオに対応のデジタル化資産は、インフレヘッジやシティ・オブ・ロンドンの中心にある商業用不動産から生まれる', text3: 'Quin紹介', text4: 'Quinは2018年の春に設計した一種の新型暗号数字硬貨であり、グローバル貨幣のためにもう一種の解決案を提供するためである。最高投資標準の確定性を獲得し、同時に所有権の安全を確保する。', text5: '1.1 第一期発行の価額', text6: 'Q (time=0) = 1ユーロ = Q.Arthur NAV(0)', text7: 'Q (time=0):Quin第一期発行価額', text8: 'Q.Arthur NAV(0): Q.Arthur社一株のNAVの見積', text9: '1.2 第一期の発行規模', text10: '£100,000,000,イーサリアム(Etherum)チェーンが運営', text11: '1.3 Quinの構造図', text12: 'Quinの設計理念', text13: 'Quinの設計理念はグローバル貨幣のために一種の新しい解決案を提供するに由来する。ピット硬貨の理想数値特性を人々は過去数千年の間に感じた安心な伝統資産中の内在価値と結合させた。', text14: '2.1 価値保全', text15: '国際金融中心の核心地理位置の不動産等グローバルで上質な資産が支持している投資であり、Q.Arthurグローバル資産管理チームが経営する。', text16: '2.2 資金流動', text17: '投資者がQ.Arthur取引所で所持しているQ代用硬貨を取引し、法定貨幣に取り替え、逆の場合も同じ。', text18: '2.3 投資者に対する優勢', text19: '資産の組合せと資産の選択', text20: '3.1 資産の選択', text21: '資産の選択:真実的な内在価値、固定収益の別種な投資組み合わせを備えている', text22: '3.2 不動産の主要な投資スタイルと営利モード', text23: '投資スタイルとリスク好み及び資産別に基づき、主に四大種類に分類する', text24: '3.3 商業不動産のキャッシュフローの構成', text25: 'この三部分の和は所持する商業不動産の合計キャッシュフローであり、繰り返し原理を通じこれらのキャッシュフローの内部収益率(IRR)を求めることが出来る。', text26: '3.4 シティ・オブ・ロンドン', text27: 'シティ・オブ・ロンドン(City of London)、イギリスロンドンの32の区の一つであり、ロンドン著名なセントポール大聖堂の東側に位置し、テムズ河の左岸の面積は2.6平方キロメートルしかなく、故に「1平方マイル」(Square Mile)とも称されている。ここには「銀行の王様」と称されるイングランド銀行等大量な金融期間が並ぶため、シティ・オブ・ロンドンとも称されている。', text28: '3.5 Quinの長期的目標', text29: '長期的目標:流通している数字地球', text30: '業績評価と分配', text31: 'もし我々は収入型戦略を不動産投資に応用し事例研究とする場合、この類の投資構造は賃借者の賃借料から収益を得る 。これにより賃借料支払い後とその後の再投資の必要性を消去したー効率低下は下げられず、特に多種の外国為替位取引時。', text32: '逆に、現在我々の構造設計は投資者はQuinsの取引価額を通じ、毎回の資本増値を享受することができる。', text33: 'Q.Tokenの数量は減少している、各O.Tokenの内在価値は増加している。', text34: '4.1 分配フロー図', text35: '4.2 事例説明', text36: 'もし設立時:100,000,000 個の代用硬貨、 100,000,000 ユーロの資産純価値に対応(£1/代用硬貨)', text37: 'Quinの共同認識メカニズム', text38: 'Quinはブロックチェーンの一つの単独メインチェーン、マルチサイドチェーンのシステムであり、メインチェーンはセーフティーネットが維持し、PoW共同認識メカニズムを採用している。サイドチェーンは異なる種類の具体業務に使われ、業務の参加者が維持し、DpoS共同認識を採用している。', text39: 'メインチェーンのPoWメカニズムはインターネットの安全性と公平性を保証しており、メインチェーン自身は具体的な業務に参加せず、基礎的なアカウント情報の維持、サイドチェーン基本スペックの維持、サイドチェーンデータ検証記録、及びサイドチェーンのクロースチェーン通信等機能のみを提供する。これら機能自身の業務のロジスティクスは簡単で、頻度が低く、インターネット処理に対する要求も高くなく、故にメインチェーン上でPoWメカニズムを採用することはインターネット性能のネックにはならない。', text40: '5.1 Quinのビジョン', text41: 'Quinのビジョンは公平、安全、且つ経済的、高効率である。我々はPoWとDPoS二種類の共同認識メカニズムを融合しQuinのブロックチェーンを実現した。', text42: '5.2 メインチェーン&サイドチェーンのモード', text43: 'Quinブロックチェーンの設計モードは、最大程度にQuinの業務モードとマッチングさせてある。Quinの設計は主に資産管理を用いて、「伝統金融と暗号世界の橋」を発足し、業務モードも組合チェーンの設計にぴったりである。', text44: '1、サイドチェーンーの処理頻度が大きく、限度額は小さい、サイドチェーン上では頻度が大きく、限度額が小さい、参加側の組織構造が簡単で高頻度な業務と取引ができる。資産管理応用の中では、最も典型なのは銀行内の振込である。銀行内の振込は必ずリアルタイム、高効率、且つ分布式システム中の一致性を保証しなければならない。故にチェーン上での取引は必ずDPoS類似な技術サポートを採用しなければならない。', text45: '2、メインチェーン– 処理頻度が小さく、限度額が大きく、メインチェーン上での処理限度額が大きい、参考側の組織構造が複雑で、頻度が高くない決算類の業務と取引ができる。典型的なのはクロース資産類の決算である。二つの取引相手は信用限度額の設置を実現し、ユーザーがクロース資産類(クロースチェーン)の両替等取引を提出し取引時、各自はチェーン内で信用限度額の中から及び各自チェーン内のアカウントから両替をする。定期決算時、二つのチェーンは直接その時間周期内に発生した総資産移転決算を行う。なぜならば決算頻度が低い場合(もし銀行間の決算であれは一日に一回のみ)、メインチェーン上の取引用のPoW協議は最大程度に取引の安全性を保証できるからである。', text46: 'メインサイドチェーンの設計案、特別にサイドチェーンに対する「監査可能性」を考量する必要が有る。メインチェーンはPoWであり、安全性は保証されている、サイドチェーンはDPoS共同認識であり、集中化に偏っており、どうやってサイドチェーンの信用度を増す?我々はアンカリング(Anchoring)技術を利用し、Merkle Treeデータ構造を使い、サイドチェーンデータの監査可能性を保証した。監査可能のアンカリング(Anchoring)の実行手順は以下となる:', text47: 'この方法はPoWとPoS共同認識メカニズムの長所を吸収し、各自の短所を避けており最大程度上にインターネットの公平、安全を保証したと同時に、比較的高い効率も保証し、また我々Quinシーンの最適な底層設計案となった。', text48: '', text49: '' }, assetRecite: { context1: '未来最高な方法を創造すること即ち未来に参加する', context2: '小さな資産を大きな資産で引っ張っていくことで世界規模を持つサプライチェーンをつくっている', itemDatas: [ { urlImg: require('../../assets/images/assetRecite/b1.png'), title: 'シティ・オブ・ロンドンオフィスビル', investment: '投資金額:3940万ユーロ', profit: '投資収益:5.83%', category: '投資タイプ:商業不動産', london: '地理位置:シティ・オブ・ロンドン', windon: '投資の注目点 ', explain: 'シティ・オブ・ロンドンはイギリスロンドンの32の区の一つであり、ロンドン著名なセントポール大聖堂の東側に位置し、面積は2.6平方キロメートルしかなく、故に「1平方マイル」(Square Mile)とも称されている、ここに大量な銀行、証券取引所、金マーケット等金融機構が密集しており、故にシティ・オブ・ロンドンとも称されている。過去十年間、シティ・オブ・ロンドンの商業不動産の賃貸販売比率は4%より以下になったことがなく、2018年のグローバル金融危機時リスク回避のための資金のペスト選択の地とされており、一時7%に達したこともあった。今回入札のオフィスビルの地理位置はとてもよく、多数の知名な金融機関の進駐を引きつけており、ずっとフルレント状態でした。', network: '交通ネットワーク ', workcon: 'ビルの位置はシティ・オブ・ロンドンに連接しており、徒歩でシティ・オブ・ロンドンを回りきることができ、MonumentとBankの地下鉄駅に連接している。', payments: '定期支払い ', paymentscon: '物件の利益(賃貸料)は定期的に投資者に支払われ、年収益は5.83%である。', detailsBtn: '詳細チェック', auditBtn: '監査報告' }, { urlImg: require('../../assets/images/assetRecite/b2.png'), title: 'シティ・オブ・ロンドンオフィスビル', investment: '投資金額:2160万ユーロ', profit: '投資収益:5.02%', category: '投資タイプ:商業不動産', london: '地理位置:シティ・オブ・ロンドン', windon: '投資の注目点 ', explain: 'ロンドンはグローバルの「一流中の一流」都市として、シティ・オブ・ロンドンはロンドン市の核心地域でもあり、その核心地域の商業不動産を一種の資産タイプとして、その供給量は有限である。一種の商品としては、グローバルトップ銀行が争って進駐したいと賃貸したい場所である。今回入札のオフィスビルは現在既に多数の金融期間と法律事務所に賃貸しており、9割の賃貸者の賃貸期間は十年であり、年間賃貸料収入は88.3万ユーロに達する見込みである。', network: '交通ネットワーク ', workcon: '徒歩5分で地下鉄駅Moorgateに到着することができる。', payments: '定期支払い ', paymentscon: '物件の利益(賃貸料)は定期的に投資者に支払われ、年収益は5.02%である。', detailsBtn: '詳細チェック', auditBtn: '監査報告' } ] }, footer: { text1: 'アクセス', text2: 'お問い合わせ', text3: 'ヘルプ', text4: '投資について', text5: 'Quinの買い方', text6: 'Quin取引所', text7: 'もっと見る', text8: 'Q. Arthurについて', text9: '我々の歴史は1993年に遡ることができ、Q. Arthurはイギリス金融管理局が管理しているロンドンオクスフォードグループの子会社である。ロンドンオクスフォードグループは以前オクスフォード大学で金融仕事に携わっている学友たちが成立させた会社である。', text10: '' }, about: { text1: '数字未来、初めに行為があった', text2: '節目は新しい金融を構築、算法は新しい未来をリード', text3: 'Quinの所持者のために価値のある裏書、公平公正、資本価値保持のある成熟流通性な金融体系を創造する', text4: 'お客様重視', text5: '独立、信頼可能と創新的な意見を通じお客様と長期的な関係を築き上げ、卓越な成果実現のお手伝いをする', text6: '廉潔原則', text7: '厳しくいつでもとどんな状況下でも正しいことをする原則を遵守する', text8: '卓越な標準', text9: '断じて動かず信念を堅持し且つ最高の品質標準に達するように努力する', text10: '尊重', text11: '多元化に抱きしめ、且つ最大な尊厳と尊重で全ての人に接する', text12: '人材', text13: '最も才能のある人材を誘い且つ彼らの最大な潜在能力を発揮させ、対価を通じて報いを得るチャンスを得る', text14: 'パートナー', text15: '励まし誠実弁論な文化を提唱し、優秀な創立者とパートナー関係を締結する', text16: '我々の使命', text17: '我々がお客様に対する使命は、グローバル範囲の上質な資産と厳しい受託管理を提供し、現地のマクロ経済とインフレのリスクヘッジを行う。', text18: '我々の理念', text19: '我々の理念は透明、安定とインフレの数字化資産ヘッジを創立することであり、且つ一括な高品質伝統資産を後ろ盾とし、伝統「法定貨幣」資産管理世界と「暗号数字硬貨」世界の間のギャップを癒す。', text20: '先陣と創新者', text21: 'もっと見る', person: [ { name: 'David Quinn', post: '創始者&最高経営責任者', text: 'David Quinnは制規会社の資本マーケットで取引方面において15年以上の従事経験がある。Davidはずっとジブラルタルで制規の株式仲買会社を経営しており、一日の取引量が最高で1億ドルに達することができる。Davidはリーマン・ブラザーズで職業生涯を始め、その後Bear Stearns Cosの取締総経理に就任した。Bear Stearns Cosを離れたあとGlobal Fortune Investment Limited Copyright(GFI)ロンドンの株式取引業務を管理していた。DavidはQ. Arthur数字貨幣取引プラットフォームを設立した。' }, { name: 'Steve Kelso', post: 'コンサート委員会主席', text: 'Steveは発展マーケットと新興マーケットの投資と取引領域において22年の職業経験を有している。彼はヨーロッパで初の変動性金利裁定基金を出し、KBC(DE Shaw基金の前身)は二年以内に7億ドルの投資を引きつけた。Q. Arthurに加入する前、彼は南アフリカのFirstRand傘下の専門資産管理会社アシュバートンインターナショナル(Ashburton International)で最高経営責任者を担当していた。その前に、彼はルネサンスキャピタル(Renaissance Capital)の戦略取引チームの責任者及び投資委員会主席を担当していました。' }, { name: 'Chaiyakorn Yingsaeree 博士', post: '共同設立者&最高技術責任者', text: 'Chaiyakornは金融量的取引業界で10年以上の経験を有している。彼はロンドン大学(UCL)で金融コンピューター博士学位を取得し、金融計算と算法取引に専念していた。彼は現在イギリスの制規を受けている会社におり、ロンドンに位置し資産管理会社の最高運営責任者を担当している。かつではニューヨークのCitadel投資グループで量的取引の研究員を担当し、アメリカOTC証券マーケットの高頻度マーケットのためにマーケットメーカー及びマーケットメーカー戦略のために価額予測算法の制定を担当していた。' }, { name: 'Allan Lane 博士', post: '高級顧問', text: 'Allan LaneはTwenty20 Investmentsの設立パートナーである。Allanはかつでは投資銀行で複数の高級役職を担当しており、Barclaysグローバル投資者部門固定収益チームとスコットランドローヤル銀行グローバル量的研究部門で主管を担当していたことを含む。彼はかつではフランスパリ銀行(Banque Paribas)とJPモーガンで株式の派生品模型の責任者を担当していた。Allanはオクスフォードとケンブリッジ大学の数学系を卒業し、アメリカワシントン大学で博士学位を取得した。' }, { name: 'Irene Bauer 博士', post: '高級顧問', text: 'Irene はTwenty20 Investmentsのもう一人の設立パートナーである。その前、IreneはずっとBlackRockのiShares部門に在籍し、お客様にETF投資組合解決案を提供していた。彼女がBarclaysグローバル投資者部門で勤務している間、Ireceは主動固定収益の資産配置チームの中で仕事をしていた。Ireceはドイツアウクスブルク大学で数学学位を獲得し、またドイツハイデルベルク大学で数学博士学位を獲得している。' } ] }, newViewPage: { context1: '世界の中心にフォーカスして、未来の動向を見通す', context2: '予測不可能な将来では、無数というほどの変革などが起こる。私達は未来を見通して、そのために様々な準備を整えている', context3: '最新情報', text1: '世界の中心にフォーカスして、未来の動向を見通す', text3: '予測不可能な将来では、無数というほどの変革などが起こる。私達は未来を見通して、そのために様々な準備を整えている', text4: 'イノベータのアドバイス', text5: 'もっと見る', text6: '新たな視点', text7: 'お客様の場所', text8: '配信時間', text9: 'ホームページ', text10: '前のページ', text11: '次のページ', text12: '最後のページ', text13: 'スキップ', text14: '最初のページ' }, faq: { title: 'Q&A', issueData: [ { issueName: 'Q1', title: '数字硬貨Quinは価値保全面において優勢はありますか?', answerName: 'A1', text: '我々の数字硬貨Quin対応の建物不動産は世界金融の中心の最高な地理位置にあり、そして長期的な賃貸者はトップな国際銀行であり、代用硬貨を持っているイコールこれらの銀行があなたに賃貸料を支払っている。「金融バブル」になったとしても、紙幣は瞬間的に廃棄される可能性はあり、権益が認められない可能性もあり、しかしQuin所有者が不動産に対する所有権は依然と変わらず、また、ユーザーの資産は将来ある時間帯でもトレサビリティーすることができ、請戻しされ、資産損失を避けることができる。' }, { issueName: 'Q2', title: 'リスク評価をしたことはある?これらのプロジェクトのビジョンはどう見ている?失敗の可能性はある?', answerName: 'A2', text: '1971年法定貨幣が金から脱離したときから、ロンドン核心商業不動産の年平均収益は10%に達しており、スーパーリスク回避資産となっており、過去十年間、シティ・オブ・ロンドンの商業不動産の賃貸販売比率は4%より以下になったことがない。同時に、そのほか資産裏書のない暗号数字硬貨がマーケット上に置いての価額の状況を参考にし、資産裏書ありの暗号数字硬貨Quinの値上げ空間は巨大である。それ以外に、全ての不動産の投資は独立側(例:普華永道会計事務所)の詳細な検証と財務監査を経ており、詐欺を避け、プロジェクトのリスクを低減する。' }, { issueName: 'Q3', title: 'Quinを所持する場合の報いは?', answerName: 'A3', text: 'Quinの譲渡資産賃貸販売比率は約5%、しかしこの類の資産の信用譲渡は非常に高い資産利益と低い資産原価を獲得することができ、それにより資産収益が12%以上になり、このような巨大な投資収益は、ビジネス銀行では提供ができない。' }, { issueName: 'Q4', title: 'プロジェクトの公開透明性はどうのように保証している?', answerName: 'A4', text: 'Q.Arthur社は公式サイトを使いプロジェクトの公示を行い、またグローバルで知名な法律事務所が担保となり、Quinと資産のバンディング関係を確保している。普華永道会計事務所が会計監査し、資産収益の公開透明性を確保する。' }, { issueName: 'Q5', title: 'Quinプロジェクトはどのように稼いでいる?', answerName: 'A5', text: 'Quinはインフレ対策、地方分権化の暗号数字硬貨だけではなく、グローバルで最も核心な資産を担保とし、Quinを持つことはイコールシティ・オブ・ロンドンこの類の世界絶対的な中心地域の商業不動産を所持している、これらの不動産の賃貸者はみんな名声の高い世界級銀行、保険、大型基金等金融食物連鎖トップの機構であり、この世界の富を代表しており、しかし彼らはQuin所持者に賃貸料を払っている!' }, { issueName: 'Q6', title: 'Quinはどうやって現実資産と結びつく?', answerName: 'A6', text: 'Quinの資金は現実世界の金融不動産に投資され、投資した不動産が多いほど、Quinの価値が高くなる、それと現実資産との結びつきがより緊密になる。' }, { issueName: 'Q7', title: 'どうやって賃貸料をもらう?', answerName: 'A7', text: 'これは簡単であり、Q.Arthur社は定期的にQuin所有者のユーザーアカウントに所有資産等比率の配当収益を振込、この配当収益は不動産の賃貸料である。' }, { issueName: 'Q8', title: 'Quinはどうやって発行している?', answerName: 'A8', text: 'Quinはブロックチェーンの一つの単独メインチェーン、マルチサイドチェーンのシステムであり、メインチェーンはセーフティーネットが維持し、PoW共同認識メカニズムを採用している。サイドチェーンは異なる種類の具体業務に使われ、業務の参加者が維持し、DpoS共同認識を採用している。これらを頼りにQuinの発行を実現している。第一期の発行金額は1億ユーロに達する予定である。' } ] } } export default JP
/** * Config for SASS */ 'use strict'; module.exports = { options: { cacheLocation: '/<%= paths.app %>/.temp/.sass-cache', }, dev: { options: { style: 'expanded', sourcemap: true, trace: true, unixNewlines: true, debugInfo: true, lineNumbers: true, loadPath: '<%= paths.app %>/resources/styles' }, files: [{ expand: true, cwd: '<%= paths.app %>/resources/styles', src: ['{,*/}*.scss'], desc: './', ext: '.css' }] }, dist: { options: { style: 'compressed', sourcemap: false, trace: false, unixNewlines: false, debugInfo: false, lineNumbers: false } } };
/** * * convert a weight or mass to grams. * * @param mass The weight or mass to be converted * @param units the abbreviation for the inits specified in the mass * @return the converted mass in grams **/ // function convertToGrams(mass, units) { // convertedValue = 0; // // if (units === 'g'){ // return mass; // } else if (units === 'lbs') { // return mass * 453.592 // } else if (units === 'oz') { // return mass * 28.35; // } else if (units === 'kg') { // return mass * 1000; // } else if (units === 'mg'){ // return mass/1000 // } // // return convertedValue; // } // console.log(convertToGrams(10,lbs)); /** * Adds the unique positive factors of a number * * @param number The number to be factored * @return the sum of the factors **/ function sumUniquePositiveFactors(number) { let sum = 0; for (i=1; i<=number; i++) { if(number % i === 0) { sum = sum = i; } } return sum; }
const express = require('express'); const server = express(); var data = []; server.get('/', (req, res) => { var value1 = req.query.sensor1; data.push(value1); const responsestr = `sensor1: ${value1}`; res.status(200).send(responsestr); console.log(responsestr); }); server.get('/historical', (req, res) => { var str = 'Historical data: <p>'; data.forEach(value => { str = str + value + '<br>'; }); res.status(200).send(str); }); server.listen(5000, () => { console.log('server started on port 5000'); });
//============================================= // JQUERY DOCUMENT READY = //============================================= $("document").ready(function() { // Side Navbar Functionality if ($(window).outerWidth() > 992) { $('nav.side-navbar').hover( function () { $(this).removeClass('shrink'); $('.page').removeClass('active'); }, function () { $(this).addClass('shrink'); $('.page').addClass('active'); } ); } // Side Navbar Mobile $('#toggle-btn-open').on('click', function (e) { e.preventDefault(); if ($(window).outerWidth() < 992) { $('nav.side-navbar').toggleClass('shrink'); $(this).toggleClass('active'); } else { return false; } }); // External links to new window $('.external').on('click', function (e) { e.preventDefault(); window.open($(this).attr("href")); }); // Box search show more $(".btn-show-more-search").on("click", function() { $(".box-more-search").toggleClass("active"); $(this).toggleClass("active"); }); // Box search Mobile $('#btn-toggle-search').on('click', function (e) { e.preventDefault(); if ($(window).outerWidth() < 576) { $('.box-toggle-search').addClass('active'); } }); $('.remove-toggle-search').on('click', function (e) { e.preventDefault(); if ($(window).outerWidth() < 576) { $('.box-toggle-search').removeClass('active'); } }); resize(); });//document.ready //============================================= // JQUERY WINDOW RESIZE = //============================================= $(window).on('resize', resize); function resize() { if ($(window).outerWidth() > 992) { $('nav.side-navbar').addClass('shrink'); } else { $('nav.side-navbar').removeClass('shrink'); } } //windows.resize //============================================= // JQUERY WINDOW LOAD == //============================================= $(window).on('load', function(){ }); //windows.load //============================================= // Add/Remove column datatable display //============================================= // add all column to current list $('body').on('click', 'button.add-all', function(){ $(this).removeClass('add').addClass('disabled'); var element = $('#allColumn').each(function(){ var li_element = $(this).html(); $('#currentColumn').append(li_element); }); $('#allColumn').find('.li').remove(); $('#currentColumn').find('.li button').removeClass('add').addClass('remove'); }); // remove all column to current list $('body').on('click', 'button.remove-all', function(){ // $(this).removeClass('remove').addClass('disabled'); var element = $('#currentColumn').each(function(){ var li_element = $(this).html(); $('#allColumn').append(li_element); $('#allColumn').find('.li.fixed').remove(); }); $('#currentColumn').find('.li:not(".fixed")').remove(); $('#allColumn').find('.li button').removeClass('remove').addClass('add'); }); // add column current list $('body').on('click', '#allColumn button', function(){ $(this).removeClass('add').addClass('remove'); var element = $(this).parents('.li').html(); var target = $('#currentColumn'); target.append('<li class="li">'+element+'</li>'); $(this).parents('.li').remove(); }); // remove column current list $('body').on('click', '#currentColumn .li:not(".fixed") button', function(){ $(this).removeClass('remove').addClass('add'); var element = $(this).parents('.li').html(); var target = $('#allColumn'); target.append('<li class="li">'+element+'</li>'); $(this).parents('.li').remove(); });
var client; var request; function useMic() { return true;//document.getElementById("useMic").checked; } function getMode() { return Microsoft.CognitiveServices.SpeechRecognition.SpeechRecognitionMode.shortPhrase; } function getKey() { return "6e721e43eb1141b8bbeda4a64c867243"; //document.getElementById("key").value; } function getLanguage() { return "en-us"; } function clearText() { document.getElementById("output").value = ""; } function setText(text) { document.getElementById("output").value += text; } function getLuisConfig() { var appid = document.getElementById("luis_appid").value; var subid = document.getElementById("luis_subid").value; if (appid.length > 0 && subid.length > 0) { return { appid: appid, subid: subid }; } return null; } function start() { var mode = getMode(); var luisCfg = getLuisConfig(); clearText(); if (useMic()) { if (luisCfg) { client = Microsoft.CognitiveServices.SpeechRecognition.SpeechRecognitionServiceFactory.createMicrophoneClientWithIntent( getLanguage(), getKey(), luisCfg.appid, luisCfg.subid); } else { client = Microsoft.CognitiveServices.SpeechRecognition.SpeechRecognitionServiceFactory.createMicrophoneClient( mode, getLanguage(), getKey()); } client.startMicAndRecognition(); setTimeout(function () { client.endMicAndRecognition(); }, 5000); } else { if (luisCfg) { client = Microsoft.CognitiveServices.SpeechRecognition.SpeechRecognitionServiceFactory.createDataClientWithIntent( getLanguage(), getKey(), luisCfg.appid, luisCfg.subid); } else { client = Microsoft.CognitiveServices.SpeechRecognition.SpeechRecognitionServiceFactory.createDataClient( mode, getLanguage(), getKey()); } request = new XMLHttpRequest(); request.open( 'GET', (mode == Microsoft.CognitiveServices.SpeechRecognition.SpeechRecognitionMode.shortPhrase) ? "whatstheweatherlike.wav" : "batman.wav", true); request.responseType = 'arraybuffer'; request.onload = function () { if (request.status !== 200) { setText("unable to receive audio file"); } else { client.sendAudio(request.response, request.response.length); } }; request.send(); } client.onPartialResponseReceived = function (response) { return response ; //setText(response); } client.onFinalResponseReceived = function (response) { return JSON.stringify(response); //setText(JSON.stringify(response)); } client.onIntentReceived = function (response) { return response; //setText(response); }; }
/* eslint-disable import/extensions */ import { AndGate } from './../modules/andGate.js'; import globalScope from './../modules/scopes.js'; const assert = chai.assert; describe('Testing : Component :: AndGate ', () => { const andGate = new AndGate(10, 10, globalScope); it('andGate object should be defined', (done) => { // attempt to create andGate object try { const andGate = new AndGate(10, 10, globalScope); done(); // catch error } catch (e) { done(e); } }); it('x coordinates should be numbers', () => { assert.isNumber(andGate.x); }); it('y coordinates should be numbers', () => { assert.isNumber(andGate.y, 'y coordinate should be a number'); }); it('bidwith should be integer', () => { assert.equal(Math.floor(andGate.bitWidth), andGate.bitWidth); }); it('bidwidth should be positive integer', () => { assert.isNumber(andGate.bitWidth); assert.isAbove(andGate.bitWidth, 0, 'Bidwith should be a positive'); }); it('rectangleObject should be boolean', () => { assert.isBoolean(andGate.rectangleObject); }); it('rectangleObject should be boolean', () => { assert.isBoolean(andGate.rectangleObject); }); it('input element storage should be stored in array', () => { assert.isArray(andGate.inp); }); it('inputSize should be integer, number', () => { assert.isNumber(andGate.inputSize); assert.equal(Math.floor(andGate.inputSize), andGate.inputSize); }); it('andGate should always resolve', () => { assert.isTrue(andGate.alwaysResolve); }); it('verilog should in string', () => { assert.isString(andGate.verilogType); }); it('tooltip text should be non empty string ', () => { assert.isNotEmpty(andGate.tooltipText); }); it('output attachment should be node', () => { assert.isObject(andGate.output1); }); console.log(andGate); });
/** * @file homeSelectorItem * * Displays an Item in homeselectorItems Scroll * * @description The selected button will appear with the text label. The other not selected will * only appear with the icon. */ import React from 'react'; import { View, StyleSheet, TouchableOpacity, Text, Image, Dimensions, Animated, } from 'react-native'; const TouchableAnimated = Animated.createAnimatedComponent(TouchableOpacity); const HomeSelectorItem = ({item, theme, setSelected, selected}) => { //INLINE STYLEs const containerInline = { // backgroundColor: theme.colors.primary, width: selected === item ? Dimensions.get('window').width / 2.6 : Dimensions.get('window').width / 5, }; const labelTextInline = { color: theme.colors.text, }; return ( <TouchableAnimated style={[styles.container, containerInline]} onPress={() => setSelected(item)}> <View style={styles.row}> <Image source={item.img} style={styles.img} /> {/* Showing text only if it is selected */} {selected === item ? ( <Text style={[styles.labelText, labelTextInline]}>{item.label}</Text> ) : ( <></> )} </View> </TouchableAnimated> ); }; const styles = StyleSheet.create({ container: { height: Dimensions.get('window').height / 14, justifyContent: 'center', borderRadius: 10, marginHorizontal: 10, }, row: { flexDirection: 'row', justifyContent: 'space-around', }, img: { width: Dimensions.get('window').width / 8, height: Dimensions.get('window').height / 18, alignSelf: 'center', marginBottom: 2, }, labelText: { fontFamily: 'System', fontSize: 16, fontWeight: 'bold', alignSelf: 'center', opacity: 0.8, }, }); export default HomeSelectorItem;
function Controller() { function toHumanNumber(currency) { var old = currency; currency = parseFloat(currency.replace(/\./g, "").replace(/\,/g, ".")); var sign = 1; if (currency < 0) { currency = -currency; sign = -1; } else if (currency == 0) return "0"; var s = [ "", "mil", "MI", "BI", "TRI", "QUA", "QUI" ], e = Math.floor(Math.log(currency) / Math.log(1000)); return (sign * currency / Math.pow(1000, e)).toFixed(1) + s[e]; } function openGraph(e) { Ti.API.info("Click: " + JSON.stringify(e)); var graphWindow = Alloy.createController("graph", { nomePapel: "WHRL4" }).getView(); nav.open(graphWindow); } require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments)); $model = arguments[0] ? arguments[0].$model : null; var $ = this, exports = {}, __defers = {}; $.__views.row = A$(Ti.UI.createTableViewRow({ height: "44dip", id: "row" }), "TableViewRow", null); $.addTopLevelView($.__views.row); $.__views.bgView = A$(Ti.UI.createView({ id: "bgView" }), "View", $.__views.row); $.__views.row.add($.__views.bgView); openGraph ? $.__views.bgView.on("click", openGraph) : __defers["$.__views.bgView!click!openGraph"] = !0; $.__views.nome = A$(Ti.UI.createLabel({ font: { fontSize: "10dp", "undefined": undefined }, width: "25%", left: "1%", id: "nome", touchEnabled: "false" }), "Label", $.__views.bgView); $.__views.bgView.add($.__views.nome); $.__views.precoSobreLucro = A$(Ti.UI.createLabel({ font: { fontSize: "10dp", "undefined": undefined }, width: "15%", left: "25%", id: "precoSobreLucro", touchEnabled: "false" }), "Label", $.__views.bgView); $.__views.bgView.add($.__views.precoSobreLucro); $.__views.retornoSobrePatrimonio = A$(Ti.UI.createLabel({ font: { fontSize: "10dp", "undefined": undefined }, width: "20%", left: "40%", id: "retornoSobrePatrimonio", touchEnabled: "false" }), "Label", $.__views.bgView); $.__views.bgView.add($.__views.retornoSobrePatrimonio); $.__views.dividaBrutaSobrePatrimonio = A$(Ti.UI.createLabel({ font: { fontSize: "10dp", "undefined": undefined }, width: "15%", left: "60%", id: "dividaBrutaSobrePatrimonio", touchEnabled: "false" }), "Label", $.__views.bgView); $.__views.bgView.add($.__views.dividaBrutaSobrePatrimonio); $.__views.patrimonioLiquido = A$(Ti.UI.createLabel({ font: { fontSize: "10dp", "undefined": undefined }, width: "24%", left: "75%", textAlign: Ti.UI.TEXT_ALIGNMENT_RIGHT, id: "patrimonioLiquido", touchEnabled: "false" }), "Label", $.__views.bgView); $.__views.bgView.add($.__views.patrimonioLiquido); exports.destroy = function() {}; _.extend($, $.__views); var args = arguments[0] || {}; $.nome.text = args.papel.nome || ""; $.precoSobreLucro.text = args.papel.precoSobreLucro || ""; $.retornoSobrePatrimonio.text = (args.papel.retornoSobrePatrimonio || "") + "%"; $.dividaBrutaSobrePatrimonio.text = args.papel.dividaBrutaSobrePatrimonio || ""; $.patrimonioLiquido.text = "R$ " + toHumanNumber(args.papel.patrimonioLiquido); var nav = args.nav; __defers["$.__views.bgView!click!openGraph"] && $.__views.bgView.on("click", openGraph); _.extend($, exports); } var Alloy = require("alloy"), Backbone = Alloy.Backbone, _ = Alloy._, A$ = Alloy.A, $model; module.exports = Controller;
import React, { Component } from 'react'; import { Platform, StyleSheet, Text, View, Button, ListView, TextInput } from 'react-native'; import firebaseApp from './firebase' import { StackNavigator, } from 'react-navigation'; export default class CharAddScreen extends Component { constructor(props) { super(props); this.CharRef = firebaseApp.database().ref(); const dataSource = new ListView.DataSource({ rowHasChanged: (row1, row2) => row1 !== row2, }); this.state = { dataSource: dataSource, newChar : { name : '', race : '' } }; } static navigationOptions = { title: "Ajouter un nouveau personnage", } render() { const navigation = this.props.navigation; // Navigation var declaration return ( <View> <TextInput onChangeText={(nameInput) => { this.setState({newChar : {name : nameInput, race : this.state.raceText}}); this.setState({nameText : nameInput})}} value={this.state.nameText} /> <TextInput onChangeText={(raceInput) => { this.setState({newChar : {name : this.state.nameText, race : raceInput}}); this.setState({text1 : raceInput})}} value={this.state.raceText} /> <Button title="Add Character" onPress={this._addChar.bind(this)} /> </View> ); } _addChar () { if (this.state.newChar.name === "" && this.state.newChar.race === "") { return; } this.CharRef.child('Characters/' + this.state.newChar.name + '/name').set(this.state.newChar.name); // set allow us to write data if they not exist OR update it if it exst this.CharRef.child('Characters/' + this.state.newChar.name + '/race').set(this.state.newChar.race); this.setState({newChar : {name : '', race : '', }}); } }
let guit = document.getElementById("guit"); guit.src = "guit.gif"+"?a="+Math.random(); let landingtab = document.getElementById("landingtab"); let ethtab = document.getElementById("ethtab"); let jantab = document.getElementById("jantab"); let coverbox = document.getElementById("coverbox"); /*function myMove1() { coverbox.style.display="block"; ethtab.style.display ="block"; let ltpos = 0; let etpos = 2000; let id = setInterval(frame, 3); function frame() { if (ltpos == -2000) { clearInterval(id); landingtab.style.display ="none"; coverbox.style.display="none"; } else { ltpos-=10; etpos-=10; landingtab.style.left = ltpos + 'px'; ethtab.style.left = etpos + 'px'; } } } guit.src = "guit.gif"+"?a="+Math.random(); //replays guitar }*/ /*function myMove1() { $("#landingtab").addClass("outslide"); ethtab.style.display="block"; } function mm1() { $("#ethtab").addClass("inslide"); } function myMove2() { $("#ethtab").addClass("outslide"); }*/ $("#landingtab").click(function(){ coverbox.style="display: block"; ethtab.style="left: 100vw; display: block"; $("#landingtab").animate({ left: '-100vw' }, 1200, function(){ landingtab.style="left: 2000px; display: none"; coverbox.style="display: none"; }) $("#ethtab").animate({ left: '0px' }, 1200) }); $("#ethtab").click(function(){ coverbox.style="display: block"; jantab.style="left: 100vw; display: block"; $("#ethtab").animate({ left: '-100vw' }, 1200, function(){ ethtab.style="left: 2000px; display: none"; coverbox.style="display: none"; }) $("#jantab").animate({ left: '0px' }, 1200) }); $("#jantab").click(function(){ coverbox.style="display: block"; landingtab.style="left: 100vw; display: block"; guit.src = "guit.gif"+"?a="+Math.random(); //replays guitar $("#jantab").animate({ left: '-100vw' }, 1200, function(){ jantab.style="left: 2000px;display:none"; coverbox.style="display: none"; }) $("#landingtab").animate({ left: '0px' }, 1200) });
import React from 'react' import { Switch, Route } from 'react-router-dom' import { Main } from '../components/templates' import { Cleverbot } from '../components/pages' const withTemplateMain = (jsxComponent, props) => ( <Main {...props}> {jsxComponent} </Main> ) const Routes = () => ( <Switch> <Route exact path="/" component={props => withTemplateMain(<Cleverbot {...props} />, props) } /> </Switch> ) export default Routes
if (typeof Global === "undefined") { Global = {}; } SiteConfigManagePanel = Ext.extend(Ext.Window, { modal: true, shim: false, id: 'siteConfigManagePanel', width: 500, height: 420, title: '站点配置', closable: false, maximizable: false, minimizable: false, border: false, buttonAlign: 'center', baseUrl: "systemConfig.java", show: function() { SiteConfigManagePanel.superclass.show.call(this); Ext.Ajax.request({ scope: this, url: this.baseUrl + "?cmd=list", success: function(data) { data = eval("("+data.responseText+")").result; if(data.length>0){ data = data[0] for(var key in data){ var curf = this.fp.form.findField(key+""); if(curf){ curf.setOriginalValue(data[key]); } } } } }); }, initComponent: function() { this.buttons = this.createButtons(); SiteConfigManagePanel.superclass.initComponent.call(this); this.buildFormItems(); this.on('show', function() { this.fp.form.isValid() }, this); }, buildFormItems: function() { this.fp = this.createFormPanel(); this.add(this.fp); }, createButtons: function() { var btns = []; btns.push({ scope: this, text: '保存', iconCls: 'save', handler: this.submitSaveCon }); btns.push({ scope: this, text: '取消', iconCls: 'delete', handler: function() { this.hide(); } }); return btns }, /** * 保存文章 */ submitSaveCon: function() { this.beforeFormSubmit('save'); }, beforeFormSubmit: function(method) { var id = this.fp.form.findField("id").getValue(); method = id ? 'update' : 'save'; Ext.Ajax.request({ scope: this, method:"POST", url: this.baseUrl + "?cmd="+method, params: this.fp.form.getValues(), success: function(data,options) { var id = options.params.id; this.fp.form.findField("id").setOriginalValue(id); this.hide(); } }); }, refurbishParentGrid: function() { }, createFormPanel: function() { var formPanel = new Ext.form.FormPanel({ frame: true, labelWidth: 70, fileUpload: true, autoScroll: true, labelAlign: 'right', defaults: { xtype: 'textfield' }, items: [{ name: "id", xtype: "hidden" }, { width: 400, fieldLabel: "站点名称", name: "siteName" }, { width: 400, fieldLabel: "域名", name: "domain" }, { width: 400, fieldLabel: "站长", name: "webmaster" }, { width: 400, fieldLabel: "邮箱", name: "email" },{ width: 400, fieldLabel: "备案号", name: "icp" }, { width: 400, fieldLabel: "关键字", name: "keywords" }, { width: 400, xtype: "textarea", fieldLabel: "版权信息", name: "copyright" }, { width: 400, xtype: "textarea", fieldLabel: "站点描述", name: "description" }] }); var fp = formPanel.getForm(); return formPanel; } });
import React from "react"; class TwitterMessage extends React.Component { constructor(props) { super(props); this.state = { input: "" }; this.maxChar = props.maxChars } handleMaxChar = (event) => { this.setState({ input: event.target.value }) } render() { return ( <div> <strong>Your message:</strong> <input type="text" name="message" id="message" value={this.state.input} onChange={event => this.handleMaxChar(event)}/> {this.maxChar - this.state.input.length} Characters left </div> ); } } export default TwitterMessage;
export const selectRoute = (data) => { return { type : 'select_route', payload : data }; }; export const setEndTime = (data) => { return { type : 'set_endTime', payload : data }; }; export const addOldTrip = (data) => { return { type : 'add_OldTrip', payload : data } } export const removeOldTrip = (index) => { return { type: 'remove_OldTrip', payload: index } } export const removeAllTrips = () => { return { type: 'remove_AllTrips' } }
$(document).ready(function(){ /* Er indhold på siden loadet ind før den går i gang med js dokumentet*/ /* Mouseover efect på fmenuen*/ $(".fmenu").mouseover(function(){ $(".facebookpost").animate({right:'0px'}, 200); }); $(".fmenu").mouseleave(function(){ $(".facebookpost").animate({right:'-600px'}, 1500); }); /* SLUT Mouseover efect på fmenuen*/ $(".biobox").mouseover(function(){ $("#urtprofile").hide(); $("#hexprofile").hide(); $("#urtprofilered").show(); $("#hexprofilered").show(); }); $(".biobox").mouseleave(function(){ $("#urtprofile").show(); $("#hexprofile").show(); $("#urtprofilered").hide(); $("#hexprofilered").hide(); }); /*return a DOM object var video = document.getElementById('videoID'); //or var video = $('#videoID').get(0); //or var video = $('#videoID')[0];*/ //return a jQuery object //var video = $('#myVideo'); //Play/Pause control clicked /*$('#playbtn').on('click', function() { alert ("HELLO"); if(video[0].paused) { video[0].play(); } else { video[0].pause(); } return false; }); $('#playbtn').on('click', function() { //alert ("HELLO"); video[0].play(); $("#playbtn").toggleClass("hidden"); $("#stop").toggleClass("hidden"); }); $('#stop').on('click', function() { //alert ("HELLO"); video[0].pause(); $("#stop").toggleClass("hidden"); $("#playbtn").toggleClass("hidden"); }); */ }); /* SLUT Dokument ready function*/
import React, { useState, useEffect } from "react"; import { Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Paper, Typography, } from "@material-ui/core"; const TableListFarms = ({ farms }) => { const [renderFarms, setRenderFarms] = useState([]); useEffect(() => { if (!farms) { return; } setRenderFarms(farms); }, [farms]); return renderFarms && renderFarms.length === 0 ? ( <Typography variant="h6"> Não foi possivel localizar as propriedades </Typography> ) : ( <> <Typography variant="h5">Propriedades deste produtor</Typography> <TableContainer component={Paper}> <Table aria-label="simple table"> <TableHead> <TableRow> <TableCell>Id</TableCell> <TableCell align="right">Nome</TableCell> </TableRow> </TableHead> <TableBody> {renderFarms && renderFarms.map((row) => ( <TableRow key={row.id}> <TableCell component="th" scope="row"> {row.id} </TableCell> <TableCell align="right">{row.nameFarm}</TableCell> </TableRow> ))} </TableBody> </Table> </TableContainer> </> ); }; export default TableListFarms;
(function () { return { layers: [{ id: 'WXY', label: '危险源', sys: 'fxfx', children: [{ id: 'WXY_JiaYouZhan', label: '加油站', typeCode: ['22A11'] }, { id: 'WXY_JiaQiZhan', label: '加气站', typeCode: ['22A13'] }, { id: 'WXY_WeiHuaPinQiYe', label: '危化品企业', typeCode: [] }, { id: 'WXY_ShiGuZaiNan', label: '事故灾难', typeCode: [ '22000', '22A00', '22A01', '22A02', '22A03', '22A04', '22A05', '22A06', '22A07', '22A08', '22A09', '22A10', '22A11', '22A12', '22A13', '22A99', '22B99', '22C00', '22C01', '22C02', '22Y00' ] }, { id: 'WXY_GongGongWeiSheng', label: '公共卫生', typeCode: ['23000', '23B00', '23C00', '23D00', '23Y00'] }, { id: 'WXY_SheHuiAnQuanYinHuan', label: '社会安全隐患', typeCode: [ '24000', '24A00', '24B00', '24C00', '24D00', '24E00', '24F00', '24Y00' ] } ] }, { id: 'FXYHD', label: '风险隐患点', sys: 'yjbz', children: [{ id: 'WXY_ZiRanZaiHaiFengXianQu', label: '自然灾害风险区', typeCode: [ '21E01', '21G01', '21Y00', '21000', '21A00', '21A01', '21A02', '21A51', '21B03', '21B06', '21B14', '21B08', '21B11', '21B12', '21D00', '21D01', '21D03', '21D04', '21D05', '21D06', '21D99', '21G00' ] }] }, { id: 'DZZH', label: '地质灾害', sys: 'yjbz', children: [{ id: 'WXY_HuaPoQu', label: '滑坡区' }, { id: 'WXY_BengTaQu', label: '崩塌区' }, { id: 'WXY_NiShiLiuQu', label: '泥石流区' }, { id: 'WXY_TaXianQu', label: '塌陷区' } ] }, { id: 'YSZY_YunShuZiYuan', label: '运输资源', sys: 'yjbz', children: [{ id: 'YSZY_DaoLuYunShu', label: '道路运输', typeCode: ['45A00'] }, { id: 'YSZY_TieLuYunShu', label: '铁路运输', typeCode: ['45B00'] }, { id: 'YSZY_HangKongQiYe', label: '航空企业', typeCode: ['45C00'] } ] }, { id: 'FHMB', label: '防护目标', sys: 'yjbz', children: [{ id: 'FHMB_XueXiao1', label: '高等学校' }, { id: 'FHMB_XueXiao2', label: '中学' }, { id: 'FHMB_XueXiao3', label: '小学' }, { id: 'FHMB_XueXiao4', label: '幼儿园' }, { id: 'FHMB_XueXiao5', label: '其它学校' }, { id: 'FHMB_DangZhengJunJiGuan', label: '党政军机关' }, { id: 'FHMB_XinWenGuangBoJiGou', label: '新闻广播机构' }, { id: 'FHMB_JinRongJiGou', label: '金融机构' }, { id: 'FHMB_KeYanJiGou', label: '科研机构' }, { id: 'FHMB_ZhongYaoChangSuo', label: '重要场所' }, { id: 'FHMB_GongZhongJuJiChangSuo', label: '公众聚集场所' }, { id: 'FHMB_FengJiengMingShengQu', label: '旅游景区' }, { id: 'FHMB_ZhongYaoShengTaiQu', label: '重要生态区' }, { id: 'FHMB_WHPCar', label: '危化品车辆' } ] }, { id: 'JCTZ', label: '监测台站', sys: 'yjbz', children: [{ id: 'JCTZ_JianCeTaiZhan', label: '一般监测台站' }, { id: 'JCTZ_ShiuWenJianCeTaiZhan', label: '水文监测台站' }, { id: 'JCTZ_ShiuKuJianCeTaiZhan', label: '水库监测台站' }, { id: 'JCTZ_QiXiangJianCeTaiZhan', label: '雨情监测台站' } ] }, { id: 'YLJG_Zong', label: '医疗机构', sys: 'yjbz', children: [{ id: 'YLJG_YiJi', label: '一级医疗机构' }, { id: 'YLJG_ErJi', label: '二级医疗机构' }, { id: 'YLJG_SanJi', label: '三级医疗机构' }, { id: 'YLJG_QiTa', label: '其他医疗机构' } ] }, { id: 'JYDW_JiuYuanDuiWu', label: '救援队伍', sys: 'yjbz', children: [{ id: 'JYDW_JiuYuanDuiWu', label: '救援队伍' }] }, { id: 'BNCS_BiNanChangSuo', label: '避难场所', sys: 'yjbz', children: [{ id: 'BNCS_GongYuan', label: '公园' }, { id: 'BNCS_GuangChang', label: '广场' }, { id: 'BNCS_BiZaiDian', label: '避灾点' }, { id: 'BNCS_JiuZhuGuanLiZhan', label: '救助管理站' }, { id: 'BNCS_LvDi', label: '绿地' }, { id: 'BNCS_QiTa', label: '其它避难场所' } ] }, { id: 'MZJ_WuZiChuBeiKu', label: '物资储备库', sys: 'yjbz', children: [{ id: 'MZJ_ZhengFuChuBeiKu', label: '政府储备库', typeCode: ['43A00'] }, { id: 'MZJ_QiYeChuBeiKu', label: '企业储备库', typeCode: ['43A01'] }, { id: 'MZJ_YingJiWuZiYuZhuangBei', label: '应急物资与装备', typeCode: ['49000'] } ] }, { id: 'DATAVIEW_TXBZ', label: '通讯保障', sys: 'yjbz', children: [{ id: 'DATAVIEW_TXBZ', label: '通讯保障', typeCode: ['44B00', '44C00', '44D00', '44E00', '44F00', '44Z00'] }] } ] } })()
import React, { useEffect, useState } from 'react'; import CardManager from './app/CardManager'; import TagManager from './app/TagManager'; import MinusIcon from './components/MinusIcon'; import PlusIcon from './components/PlusIcon'; import useUpdateResults from './hooks/useUpdateResults'; import { getTags } from './utils/firebase'; import './main.css'; const App = () => { const [openFilter, setOpenFilter] = useState(true); const [tags, setTags] = useState(new Map()); const [loadingTags, setLoadingTags] = useState(true); const { loading: loadingData, result: cardsData, updateFilters } = useUpdateResults(); useEffect(async () => { const tagsData = await getTags(); setTags(tagsData); setLoadingTags(false); }, []); const filterData = (filters) => { updateFilters(filters); }; return ( <div className={`wrapperIndicators${openFilter ? '' : ' full-content'}`}> <div className={`leftnav-title${openFilter ? '' : ' closed-filters'}`}> <div className="card2"> <h3> <button className="openFilters" title="Ocultar filtros" type="button" onClick={() => setOpenFilter(!openFilter)} > {openFilter ? ( <MinusIcon fontSize={30} color="#fff" /> ) : ( <PlusIcon fontSize={30} color="#fff" /> )} </button> <div className="text">Filtros de búsqueda</div> </h3> {loadingTags && ( <div style={{ color: '#fff', margin: '5px 15px' }}>Cargando filtros...</div> )} {!loadingTags && tags.size <= 0 && ( <div style={{ color: '#fff', margin: '5px 15px' }}>No hay filtros disponibles</div> )} </div> </div> {!loadingTags && tags.size > 0 && ( <div className={`leftnav-filters${openFilter ? '' : ' hide'}`}> <TagManager data={tags} filterData={filterData} /> </div> )} <div className="countD"> {loadingData && 'Cargando información...'} {!loadingData && cardsData.length <= 0 && 'No hay indicadores'} {!loadingData && cardsData.length > 0 && <>{cardsData.length} indicadores</>} </div> <div className="masonry-cards"> <CardManager cardsData={cardsData} /> </div> </div> ); }; export default App;
import { login, logout } from '../../actions/auth'; test('Should login to application', () => { const action = login(12345); expect(action).toEqual({ type: 'LOGIN', uid: 12345 }); }); test('Should logout of application', () => { const action = logout(); expect(action).toEqual({ type: 'LOGOUT' }); });
#pragma strict var CPselGridInt : int = -1; var CPselStrings : String[] = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14"]; function OnGUI () { CPselGridInt = GUI.SelectionGrid (Rect (Screen.width /2 *0.25, Screen.height * 0.92, Screen.width /2 *1.5, Screen.height /16 *1), CPselGridInt, CPselStrings, 14); if (CPselGridInt == 0){ Application.LoadLevel("MobileScene1"); } if (CPselGridInt == 1){ Application.LoadLevel("MobileScene2"); } if (CPselGridInt == 2){ Application.LoadLevel("MobileScene3"); } if (CPselGridInt == 3){ Application.LoadLevel("MobileScene4"); } if (CPselGridInt == 4){ Application.LoadLevel("MobileScene5"); } if (CPselGridInt == 5){ Application.LoadLevel("MobileScene6"); } if (CPselGridInt == 6){ Application.LoadLevel("MobileScene7"); } if (CPselGridInt == 7){ Application.LoadLevel("MobileScene8"); } if (CPselGridInt == 8){ Application.LoadLevel("MobileScene9"); } if (CPselGridInt == 9){ Application.LoadLevel("MobileScene10"); } if (CPselGridInt == 10){ Application.LoadLevel("MobileScene11"); } if (CPselGridInt == 11){ Application.LoadLevel("MobileScene12"); } if (CPselGridInt == 12){ Application.LoadLevel("MobileScene13"); } if (CPselGridInt == 13){ Application.LoadLevel("MobileScene14"); } }
import styled from "styled-components"; import Dialog from "~/components/atoms/dialog/Dialog"; const StyledComponentSelector = styled(Dialog)` .MuiDialogContent-root { padding-top: 0; } .buttonWrapper { margin: -4px; margin-bottom: 8px; .MuiButtonBase-root { padding: 8px 8px; margin-top: 0; margin: 4px; width: calc(50% - 8px); box-sizing: border-box; } .MuiButton-label { display: flex; flex-direction: column; } .icon { width: 1.5rem; height: 1.5rem; display: block; margin: 0.3rem; } .label { text-transform: initial; font-weight: normal; margin: 5px 10px 0; } } `; export {StyledComponentSelector};
import React, { useState, useEffect } from "react"; import { Link, useParams } from "react-router-dom"; import firebase from "firebase"; import 'bootstrap/dist/css/bootstrap.min.css' const Edit = () => { const [name, setName] = useState(' ') const [age, setAge] = useState(' ') const [location, setLocation] = useState(' ') const [des, setDes] = useState(' ') const [data, setData] = useState({}) const db = firebase.firestore(); const { id: id } = useParams(); console.log('users', data); const getName = (e) => { e.preventDefault() setName(e.target.value) } const getAge = (e) => { e.preventDefault() setAge(e.target.value) } const getLocation = (e) => { e.preventDefault() setLocation(e.target.value) } const getDes = (e) => { e.preventDefault() setDes(e.target.value) } useEffect(() => { let userInformation = []; db.collection('lists').doc(id).get() .then((res) => { setData({ ...res.data(), id: res.id }) }) .catch((err) => { console.log(err) }) .finally(() => { console.log('completed') }) setData(userInformation) console.log('lists', db.collection('lists')) }, []) const updateUser = (e) => { e.preventDefault() let uid = e.target.id db.collection('lists').doc(uid).update({ name: name, age: age, location: location, des: des }) .then(() => { console.log('Update Complete') }) .catch((err) => { console.log(err) }) } return ( <> <div className="input-group input-group-sm mt-4 mb-6"> <form onSubmit ={updateUser}> <div className="mb-3 row"> <label for="name" className="col-sm-2 col-form-label">Name</label> <div className="col-sm-10"> <input type="text" className="form-control" onChange={getName} defaultValue={data.name} /> </div> </div> <div className="mb-3 row"> <label for="name" className="col-sm-2 col-form-label">Age</label> <div className="col-sm-10"> <input type="text" className="form-control" onChange={getAge} defaultValue={data.age} /> </div> </div> <div className="mb-3 row"> <label for="name" className="col-sm-2 col-form-label">Location</label> <div className="col-sm-10"> <input type="text" className="form-control" onChange={getLocation} defaultValue={data.location} /> </div> </div> <div className="mb-3 row"> <label for="des" className="col-sm-2 col-form-label">Description</label> <div className="col-sm-10"> <input type="text" className="form-control" onChange={getDes} defaultValue={data.des} /> </div> </div> <br /> <Link to={"/Add/" + id} className='btn btn-warning' id={id} onClick={updateUser}>Update User</Link> </form> </div> </> ) } export default Edit
import React from "react"; import "./resete.css"; import { positions, Provider } from "react-alert"; import AlertTemplate from "react-alert-template-basic"; import Routes from "./routes"; const options = { timeout: 5000, position: positions.BOTTOM_CENTER }; function App() { return ( <Provider template={AlertTemplate} {...options}> <Routes /> </Provider> ); } export default App;
module.exports = { secretOrKey: 'secret', expiresIn: 3600, tokenPrefix: 'Bearer ' }
import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import { connect } from 'react-redux'; import { items } from "../actions"; import './home.css'; class DemoPage extends Component { //runs this after this component mounts componentDidMount() { } state = { text: "", updateItemId: null, } resetForm = () => { this.setState({ text: "", updateItemId: null }); } selectForEdit = (id) => { let item = this.props.items[id]; this.setState({ text: item.text, updateItemId: id }); } submitItem = (e) => { e.preventDefault(); if (this.state.updateItemId === null) { this.props.addItems(this.state.text); } else { this.props.updateItem(this.state.updateItemId, this.state.text); } this.resetForm(); } render() { return ( <div> <h2>Welcome to YMIM!</h2> <hr /> <h3>Items</h3> <table> <tbody> {this.props.items.length > 0 && this.props.items.map((item, id) => ( <tr key={`item_${id}`}> <td><Link to="/items"><img className="small_img" src={item.text} alt={item.text}></img></Link></td> <td><button onClick={() => this.selectForEdit(id)}>edit</button></td> <td><button onClick={() => this.props.deleteItem(id)}>delete</button></td> </tr> ))} </tbody> </table> <h3>Add new Item</h3> <button onClick={() => this.props.fetchItem(1)}>Get Item</button> <form onSubmit={this.submitItem}> <input value={this.state.text} placeholder="Enter item here..." onChange={(e) => this.setState({ text: e.target.value })} required /> <input type="submit" value="Save Item" /> <button onClick={this.resetForm}>Reset</button> </form> </div> ) } } const mapStateToProps = state => { return { items: state.items, } } const mapDispatchToProps = dispatch => { return { addItems: (text) => { return dispatch(items.addItem(text)); }, updateItem: (id, text) => { return dispatch(items.updateItem(id, text)); }, deleteItem: (id) => { return dispatch(items.deleteItem(id)); }, fetchItem: (num) => { dispatch(items.fetchItems(num)); }, } } export default connect(mapStateToProps, mapDispatchToProps)(DemoPage);
import React from "react"; import CenterForm from "./CenterForm"; import Typography from "@material-ui/core/Typography"; import { useStyles } from "../styles.js"; const Center = () => { const classes = useStyles(); //TODO: Pasar por props las locaciones de los centros. //TODO: Estos deben crearse al registrase cada centro. //TODO: El registro del centro debe ser llevado a cabo por Admin del centro a travez del email. //TODO: DEsde el panel del AdminApp se debe poder ver detalles del centro y modificarlo. Y visualizarlo en el mapa const action = "create"; return ( <div className={classes.admin}> <CenterForm action={action} /> </div> ); }; export default Center;
function onTouchDrag(element, onDragCallback) { const eventCountToActivation = 5; let eventCount = 0; element.addEventListener('touchstart', function (e) { eventCount = 0; }); element.addEventListener('touchmove', function (e) { eventCount++; if (e.touches.length !== 1) eventCount = 0; if (eventCount < eventCountToActivation) return; if (e.touches.length === 1) { let relativeX = e.touches[0].pageX - offset(element).left; let relativeY = e.touches[0].pageY - offset(element).top; onDragCallback({ x: relativeX, y: relativeY }); } }); } function onTwoFingerDrag(element, onDragCallback) { let previousCoordinates = null; element.addEventListener('touchmove', function (e) { if (e.touches.length === 2) { let absoluteX = (Math.max(e.touches[0].pageX, e.touches[1].pageX) - Math.min(e.touches[0].pageX, e.touches[1].pageX)) / 2 + Math.min(e.touches[0].pageX, e.touches[1].pageX); let absoluteY = (Math.max(e.touches[0].pageY, e.touches[1].pageY) - Math.min(e.touches[0].pageY, e.touches[1].pageY)) / 2 + Math.min(e.touches[0].pageY, e.touches[1].pageY); let deltaX = previousCoordinates.x - absoluteX; let deltaY = previousCoordinates.y - absoluteY; previousCoordinates = { x: absoluteX, y: absoluteY }; onDragCallback({ dx: deltaX, dy: deltaY }); } }); element.addEventListener('touchstart', function (e) { if (e.touches.length === 2) { previousCoordinates = { x: (Math.max(e.touches[0].pageX, e.touches[1].pageX) - Math.min(e.touches[0].pageX, e.touches[1].pageX)) / 2 + Math.min(e.touches[0].pageX, e.touches[1].pageX), y: (Math.max(e.touches[0].pageY, e.touches[1].pageY) - Math.min(e.touches[0].pageY, e.touches[1].pageY)) / 2 + Math.min(e.touches[0].pageY, e.touches[1].pageY) }; } }); element.addEventListener('touchend', function (e) { if (e.touches.length === 2) { previousCoordinates = null; } }); } function onPinch(element, onPinchCallback) { let initialPinchDistance = null; element.addEventListener('touchstart', function (e) { if (e.touches.length === 2) { // e.stopPropagation(); let deltas = getDeltas(e); initialPinchDistance = { dx: deltas.dx, dy: deltas.dy }; } }); element.addEventListener('touchend', function (e) { initialPinchDistance = null; }); element.addEventListener('touchmove', function (e) { let pinchThreshold = 4.5; if (e.touches.length === 2 && initialPinchDistance !== null) { let deltas = getDeltas(e); let deltaDx = initialPinchDistance.dx > deltas.dx? initialPinchDistance.dx - deltas.dx : deltas.dx - initialPinchDistance.dx; let deltaDy = initialPinchDistance.dy > deltas.dy? initialPinchDistance.dy - deltas.dy : deltas.dy - initialPinchDistance.dy; let delta = Math.sqrt(deltaDx + deltaDy); if (deltas.dx < initialPinchDistance.dx) { delta = -delta; } if (delta < pinchThreshold && delta > -pinchThreshold) return; initialPinchDistance = getDeltas(e); let absoluteX = (e.touches[0].pageX > e.touches[1].pageX? e.touches[0].pageX - e.touches[1].pageX : e.touches[1].pageX - e.touches[0].pageX) / 2; let absoluteY = (e.touches[0].pageY > e.touches[1].pageY? e.touches[0].pageY - e.touches[1].pageY : e.touches[1].pageY - e.touches[0].pageY) / 2; let relativeX = absoluteX - offset(this).left; let relativeY = absoluteY - offset(this).top; onPinchCallback({delta: delta, pageX: absoluteX, pageY: absoluteY, elementX: relativeX, elementY: relativeY}); } }); } function getDeltas(event) { let x1 = event.touches[0].pageX; let y1 = event.touches[0].pageY; let x2 = event.touches[1].pageX; let y2 = event.touches[1].pageY; let dx = (x1 > x2)? x1 - x2 : x2 - x1; let dy = (y1 > y2)? y1 - y2 : y2 - y1; return { dx: dx, dy: dy }; }
(function() { 'use strict'; angular .module('template.EntList') .controller("EntListController", function(MAINNAV, CATEGORYNAV, DETAILNAV, GetGenre){ var self = this; self.name = "Nevendra's Entertainment Page"; self.category = CATEGORYNAV; self.details = DETAILNAV; self.getGenre = GetGenre.getFullGenreList(function(isValid, response){ if(isValid) { self.superheros = response; self.superherosTwo = self.superheros; self.lastFive = GetGenre.genreLastFive(self.superheros); console.log(self.lastFive); } }) }) })();
/** * Created by Khang @Author on 15/01/18. */ const SET_LOGIN_PENDING = 'SET_LOGIN_PENDING'; const SET_LOGIN_SUCCESS = 'SET_LOGIN_SUCCESS'; const SET_LOGIN_ERROR = 'SET_LOGIN_ERROR'; const ACCOUNT_DATA = require('../data/account'); export function login(email, password) { return dispatch => { dispatch(setLoginPending(true)); dispatch(setLoginSuccess(false)); dispatch(setLoginError(null)); callLoginApi(email, password, error => { dispatch(setLoginPending(false)); if (!error) { dispatch(setLoginSuccess(true)); } else { dispatch(setLoginError(error)); } }); } } function setLoginPending(isLoginPending) { return { type: SET_LOGIN_PENDING, isLoginPending }; } function setLoginSuccess(isLoginSuccess) { return { type: SET_LOGIN_SUCCESS, isLoginSuccess }; } function setLoginError(loginError) { return { type: SET_LOGIN_ERROR, loginError } } function callLoginApi(email, password, callback) { setTimeout(() => { var checkAccount = false; var accounts = ACCOUNT_DATA.data; for (var i in accounts) { if (accounts[i].username === email && accounts[i].password === password) { checkAccount = true; } } if (checkAccount) { return callback(null); } else { return callback(new Error('Invalid email and password')); } }, 1000); }
import asset from "plugins/assets/asset"; import TitleStyle from "components/website/pages/contact-us/section-banner-top/title/TitleStyle2"; import ItemForm from "components/website/pages/contact-us/section-banner-top/items/Items"; import useWindowSize from "components/website/hooks/useWindowsSize"; import FromContact from "components/website/forms/Contact"; import { MainContent } from "components/website/contexts/MainContent"; import { useEffect, useRef, useState, useContext } from "react"; export default function BannerTop ( { urlBackground=asset("/images/bg-session-banner-contact-us.jpg"), } ){ const Language = { en: { name: "en", title: ["COMPANY","TAISHO VIET NAM "], nameForm : "Contact Us", description: "Lipovitan is a brand of Taisho Pharmaceutical company - one of the largest pharmaceutical corporations in Japan. Taisho has also expanded its business and has subsidiaries in 12 other countries around the world.", }, vi: { name: "vi", title: ["CÔNG TY TNHH","TAISHO VIỆT NAM "], nameForm : "Liên hệ", description: "Lipovitan là thương hiệu của công ty Taisho Pharmaceutical - một trong những tập đoàn dược phẩm lớn nhất Nhật Bản. Taisho cũng đã mở rộng hoạt động kinh doanh và có các công ty con tại 12 quốc gia khác trên thế giới." } } const valueLanguageContext = useContext(MainContent); const [dataBannerTop, setDataBannerTop] = useState(); const settings = { dots: false, infinite: false, speed: 500, slidesToShow: 5, slidesToScroll: 1, adaptiveHeight: true, responsive: [ { breakpoint: 1024, settings: { slidesToShow: 3, slidesToScroll: 3, infinite: true, dots: true } }, { breakpoint: 600, settings: { slidesToShow: 2, slidesToScroll: 2, initialSlide: 2 } }, { breakpoint: 480, settings: { slidesToShow: 2, slidesToScroll: 2 } } ] }; let description = (description) => ( <> <div className="desOurProduct"> <p> {/* {description} */} </p> </div> <style jsx>{` .desOurProduct{ max-width: 500px; margin: 0; p{ padding: 10px 0; font-size : 16px; line-height: 30px; color : #fff; padding-bottom: 30px; } } `}</style> </> ) // detect screen size const [responsiveMaxScreen, setResponsiveMaxScreen] = useState(false); const windowSize = useWindowSize(); //check responsive useEffect(()=>{ if(windowSize.width > 1440){ setResponsiveMaxScreen(true); }else{ setResponsiveMaxScreen(false); } },[windowSize]); useEffect(() => { if (valueLanguageContext.languageCurrent) { setDataBannerTop(Language[`${valueLanguageContext.languageCurrent}`]) } }, []) useEffect(() => { if (valueLanguageContext.languageCurrent) { setDataBannerTop(Language[`${valueLanguageContext.languageCurrent}`]) } }, [valueLanguageContext.languageCurrent]); return<section> <div className="sectionBannerTop"> { windowSize.width < 1023 ? (<> <img className="bgBannerTop" src={asset("/images/bg-session-banner-contact-us-m.jpg")}/> </>) :(<> <img className="bgBannerTop" src={urlBackground}/> </>) } { dataBannerTop ?<TitleStyle textLine1={dataBannerTop.title[0]} textLine2={dataBannerTop.title[1]} description={description(dataBannerTop.description)} /> :<></> } { windowSize.width < 1023 ? (<> <ItemForm width={96} height={45} bottom= {"1"} right={2} animation={true} name={dataBannerTop ? dataBannerTop.nameForm :"Contact Us"} nameStyle={{width: "100%"}} urlImage={asset("/images/bg-from-session-banner-contact-us-m.jpg")} > <FromContact></FromContact> </ItemForm> </>) :(<> <ItemForm width={43.47} height={75.21} top= {17.75} right={3.47} animation={true} name={dataBannerTop ? dataBannerTop.nameForm :"Contact Us"} nameStyle={{width: "100%"}} urlImage={asset("/images/bg-from-session-banner-contact-us.png")} > <FromContact></FromContact> </ItemForm> </>) } <div className="containerBannerTop" > </div> </div> <style jsx>{` .bgBannerTop{ width: 100%; height: 100%; } .sectionBannerTop{ position: relative; } .containerBannerTop{ position: absolute; width: 80%; left:50%; top : 50%; transform: translate(-50%, -50%); display: inline; justify-content: space-between; } @media screen and (max-width: 1440px) { .containerBannerTop{ bottom : 7%; } } `}</style> </section> }
var searchData= [ ['joueur_5fcontre_5fjoueur_2ec',['joueur_contre_joueur.c',['../joueur__contre__joueur_8c.html',1,'']]] ];
/** * Created by k.allakhvierdov on 11/8/2014. */ var async = require('async'); var config = require('./../sconfig'); var log = require('./../libs/log')(module); var Time = require('./../libs/time'); var currentTime = new Time(); var Dbq = require('./../libs/dbq'); var dbq = new Dbq; var Promise = require('q'); function Calendar(){ this.getUsers = function(req, res) { var arrayOrPromises = [dbq.doSet('SELECT name, sname, id FROM user'), dbq.doSet('SELECT * FROM team')]; Promise.all(arrayOrPromises).then(function (arrayOfResults) { res.render('calendar', {users:arrayOfResults[0], teams:arrayOfResults[1], req:req}); }); } this.addDateInfo = function(req, res, newDate) { var input = JSON.parse(JSON.stringify(newDate)); var data = { uid : input.uid, type : input.leaveType, date : input.date }; if (input.leaveType == 'Holiday'){ var arrayOrPromises = [dbq.doSet("INSERT INTO calendar (uid) SELECT id FROM user"), dbq.doSet("UPDATE calendar set date=?, type='Holiday' WHERE type = ''", [data.date])]; Promise.all(arrayOrPromises).then(function (arrayOfResults) { res.send('ok'); }); } else { var aor = [dbq.doSet("SELECT * FROM calendar WHERE date = ? AND uid = ?", [data.date, parseInt(data.uid)])]; Promise.all(aor).then(function (arrOfRes) { if (arrOfRes[0][0]) { var arrayOrPromises = [dbq.doSet("UPDATE calendar set ? WHERE date = ? AND uid = ?", [data, data.date, parseInt(data.uid)])]; Promise.all(arrayOrPromises).then(function (arrayOfResults) { res.send('ok'); }); } else { var arrayOrPromises = [dbq.doSet("INSERT INTO calendar set ?", data)]; Promise.all(arrayOrPromises).then(function (arrayOfResults) { res.send('ok'); }); } }) } } this.getMonthInfo = function(req, res){ var query = "SELECT id, name, sname, tid FROM user"; var arrayOrPromises = [dbq.doSet("SELECT * FROM calendar ORDER BY date, uid"), dbq.doSet(query)]; Promise.all(arrayOrPromises).then(function (arrayOfResults) { res.send(arrayOfResults); res.end(); }); } this.deleteDate = function(req, res, id, month, day){ console.log(id); var date = '%'+month+'-'+day; var query = 'DELETE FROM calendar WHERE uid = '+id+' AND date LIKE ?'; var arrayOrPromises = [dbq.doSet(query, [date])]; Promise.all(arrayOrPromises).then(function (arrayOfResults) { res.send(arrayOfResults); res.end(); }); } this.getL3Information = function(req, res, id){ var l3Days = "SELECT COUNT(*) FROM calendar WHERE uid = "+id+" AND type = 'L3 Day'"; var l3Leaves = "SELECT COUNT(*) FROM calendar WHERE uid = "+id+" AND type = 'L3 Leave'"; var arrayOrPromises = [dbq.doSet(l3Days), dbq.doSet(l3Leaves)]; Promise.all(arrayOrPromises).then(function (arrayOfResults) { res.send(arrayOfResults); res.end(); }); } } module.exports = Calendar;
/*Main Chart $(function () { x축 데이터 var categoriesData = ['9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00','21:00']; Highcharts.chart('container', { chart: { type: 'column' }, title: { text: '일일 매출 현황' }, xAxis: { categories: categoriesData }, yAxis: { allowDecimals: false, min: 0, title: { text: '판매량' } }, tooltip: { formatter: function () { return '<b>' + this.x + '</b><br/>' + this.series.name + ': ' + this.y + '<br/>' + 'Total: ' + this.point.stackTotal; } }, plotOptions: { column: { stacking: 'normal' } }, series: [{ name: 'John', data: [5, 3, 4, 7, 2, 5, 3, 4, 7, 2, 1, 1, 1], stack: 'male' }, { name: 'Joe', data: [3, 4, 4, 2, 5, 5, 3, 4, 7, 2, 1, 1, 1], stack: 'male' }, { name: 'Jane', data: [2, 5, 6, 2, 1, 5, 3, 4, 7, 2, 1, 1, 1], stack: 'female' }, { name: 'Jane', data: [2, 5, 6, 2, 1, 5, 3, 4, 7, 2, 1, 1, 1], stack: 'female' }, { name: 'Jane', data: [2, 5, 6, 2, 1, 5, 3, 4, 7, 2, 1, 1, 1], stack: 'female' }, { name: 'Jane', data: [2, 5, 6, 2, 1, 5, 3, 4, 7, 2, 1, 1, 1], stack: 'female' }, { name: 'Janet', data: [3, 0, 4, 4, 3, 5, 3, 4, 7, 2, 1, 1, 1], stack: 'female' }] }); }); */ /* $(function () { Highcharts.chart('container2', { chart: { type: 'line' }, title: { text: '월 매출 현황' }, subtitle: { text: '' }, xAxis: { categories: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'] }, yAxis: { title: { text: '판매 수량' } }, plotOptions: { line: { dataLabels: { enabled: true }, enableMouseTracking: false } }, series: [{ name: '아메리카노', data: [10.0, 6.0, 9.0, 19.0, 21.0, 14.0, 5.0, 4.0, 4.0, 18.0, 21.0, 15.0] }, { name: '카페라떼', data: [12.0, 3.0, 5.0, 15.0, 17.0, 12.0, 2.0, 3.0, 4.0, 13.0, 18.0, 16.0] }] }); }); */ /*$(function () { Highcharts.chart('container3', { chart: { plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false, type: 'pie' }, title: { text: '메뉴별 매출 현황' }, tooltip: { pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' }, plotOptions: { pie: { allowPointSelect: true, cursor: 'pointer', dataLabels: { enabled: true, format: '<b>{point.name}</b>: {point.percentage:.1f} %', style: { color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' } } } }, series: [{ name: 'Brands', colorByPoint: true, data: [{ name: 'IE', y: 56.33 }, { name: 'Chrome', y: 24.03, sliced: true, selected: true }, { name: 'Firefox', y: 10.38 }, { name: 'Safari', y: 4.77 }, { name: 'Opera', y: 0.91 }, { name: 'Other', y: 0.2 }] }] }); }); */ /*원재료 재고*/ /*$(function () { var categoriesData = [ ['Shanghai', 23.7], ['Lagos', 16.1], ['Istanbul', 14.2], ['Karachi', 14.0], ['Mumbai', 12.5], ['Moscow', 12.1], ['São Paulo', 11.8], ['Beijing', 11.7], ['Guangzhou', 11.1], ['Delhi', 11.1], ['Shenzhen', 10.5], ['Seoul', 10.4], ['Jakarta', 10.0], ['Kinshasa', 9.3], ['Tianjin', 9.3], ['Tokyo', 9.0], ['Cairo', 8.9], ['Dhaka', 8.9], ['Mexico City', 8.9], ['Lima', 8.9] ]; Highcharts.chart('container4', { chart: { type: 'column' }, title: { text: '원재료 재고 현황' }, subtitle: { text: 'Source: <a href="http://en.wikipedia.org/wiki/List_of_cities_proper_by_population">Wikipedia</a>' }, xAxis: { type: 'category', labels: { rotation: -45, style: { fontSize: '13px', fontFamily: 'Verdana, sans-serif' } } }, yAxis: { min: 0, title: { text: 'Population (millions)' } }, legend: { enabled: false }, tooltip: { pointFormat: 'Population in 2008: <b>{point.y:.1f} millions</b>' }, series: [{ name: 'Population', data: categoriesData, dataLabels: { enabled: true, rotation: -90, color: '#FFFFFF', align: 'right', format: '{point.y:.1f}', // one decimal y: 10, // 10 pixels down from the top style: { fontSize: '13px', fontFamily: 'Verdana, sans-serif' } } }] }); }); */
// var myApp = angular.module('myApp', ['ngRoute']); // myApp.config(function($routeProvider) { // $routeProvider // .when("/", { // templateUrl : "../templates/start/index.html" // }) // .when("/part_two", { // templateUrl : "../templates/new/index.html" // }) // .otherwise({ // templateUrl : "../templates/start/index.html" // }); // }); // myApp.controller('AppCtrl', ['$scope', '$http', function($scope, $http) { // //console.log("Hello World from controller"); // var refresh = function(){ // $http.get('/horselist').success(function(response){ // //console.log(response); // $scope.horses = response; // }); // }; // refresh(); // $scope.findTable = function () { // $scope.newLoding = true; // $( "#download-json" ).empty(); // var res = $scope.url_address.substring( $scope.url_address.length - 13); // var replace = res.replace(/\//g , "_"); // //console.log(res,replace); // var data = { // url: $scope.url_address // }; // $http.post('/newrequest', data).success(function (res) { // //console.log(res); // if(res){ // $scope.newLoding = false; // $scope.newHorses = res; // var data = "text/json;charset=utf-8," + encodeURIComponent(JSON.stringify($scope.newHorses)); // $('<a href="data:' + data + '" download="'+replace+'.json">download JSON</a>').appendTo('#download-json'); // } // }) // } // }]); var myApp = angular.module('myApp', ['ngRoute']); myApp.config(function($routeProvider) { $routeProvider .when("/", { templateUrl: "../templates/start/index.html" }) .when("/part_two", { templateUrl: "../templates/new/index.html" }) .otherwise({ templateUrl: "../templates/start/index.html" }); }); myApp.controller('AppCtrl', ['$scope', '$http', function($scope, $http) { //console.log("Hello World from controller"); var refresh = function() { $http.get('/horselist').success(function(response) { //console.log(response); $scope.horses = response; }); }; refresh(); $scope.findTable = function() { $scope.newLoding = true; $("#download-json").empty(); var res = $scope.url_address.substring($scope.url_address.length - 13); var replace = res.replace(/\//g, "_"); //console.log(res,replace); var data = { url: $scope.url_address }; $http.post('/newrequest', data).success(function(res) { //console.log(res); if (res) { $scope.newLoding = false; $scope.newHorses = res; var data = "text/json;charset=utf-8," + encodeURIComponent(JSON.stringify($scope.newHorses)); $('<a href="data:' + data + '" download="' + replace + '.json">download JSON</a>').appendTo('#download-json'); } }) } }]);
import styled from 'styled-components'; export const ButtonContainer = styled.View` align-items: center; justify-content: flex-end; margin-vertical: 20px; `;
export default process.env.LOCALE;
/** * info:支付 author:田鑫龙 date:2017-05-09 */ (function(){ window.lyb = window.lyb || {}; lyb.Pay = lyb.Pay || {}; // 阿里支付 lyb.Pay.aliPay = function(mergeNo, callbackUrl, opener){ // callbackUrl = encodeURIComponent(callbackUrl); window.location.href = ctx + 'html/pay/alipay.html?mergeNo='+ mergeNo + '&callbackUrl=' + callbackUrl + '&opener=' + opener; }; lyb.Pay.wxH5Pay = function(mergeNo, callbackUrl){ // callbackUrl = encodeURIComponent(callbackUrl); window.location.href = ctx + 'pay/wx/h5/merge/' + mergeNo + '?returnUrl=' + callbackUrl; }; lyb.Pay.payMethod = function(){ // 微信签名 lyb.ajax(ctx + 'weixin/jsSignature', { dataType: 'json', type: 'get', data:{ url: encodeURIComponent(location.href.split('#')[0]) }, success: function (result) { var data = result.data; wx.config({ appId: data.appId, // 必填,公众号的唯一标识 timestamp: data.timestamp, // 必填,生成签名的时间戳 nonceStr: data.nonceStr, // 必填,生成签名的随机串 signature: data.signature,// 必填,签名,见附录1 jsApiList: ['checkJsApi', 'hideMenuItems', 'showMenuItems', 'onMenuShareAppMessage', 'onMenuShareTimeline', 'onMenuShareQQ', 'chooseWXPay'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 }); wx.ready(function(){ window.lyb.Pay.mergeWxPay = function(mergeNo, callback){ lyb.ajax(ctx + 'pay/wx/mp/merge/' + mergeNo + '?openid=' + params.openId, { dataType: 'json', success: function(result1){ var data1 = result1.data; wx.chooseWXPay({ timestamp: data1.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符 nonceStr: data1.nonceStr, // 支付签名随机串,不长于 // 32 位 package: data1.package, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=***) signType: data1.signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5' paySign: data1.paySign, // 支付签名 success: function (res) { // 支付成功后的回调函数 if (res.errMsg == "chooseWXPay:ok") { var count = 0; var heart = window.setInterval(function(){ heartRequest(); }, 1000); function heartRequest(){ lyb.ajax(ctx + 'order/merge/ispay/' + mergeNo, { success: function(result){ if(result.success){ if(callback){ if(!result.data || jQuery.type(result.data) != 'object') { result.data = {}; } result.data.success = true;//强制注入支付成功标识 callback(result.data); window.clearInterval(heart); } }else { if(++count == 30){ window.clearInterval(heart); if(callback) callback({success: false, msg: '支付异常,请查询微信订单详情或致电客服!'});//强制注入支付失败回调 } } } }); } heartRequest(); } }, cancel: function(res){ if (res.errMsg == "chooseWXPay:cancel") { if(callback) callback({success: false, msg: '已取消支付!'});//强制注入支付失败回调 } } }); } }); } }); wx.error(function(res){ // lyb.error('系统异常,稍后重试!'); }); } }); }; })();
var React = require('react'); var ReactBootstrap = require('react-bootstrap'); var CityLink = require('./city-link'); var CityLinkList = React.createClass({ render: function () { var renderCity = function (city) { return ( <CityLink city={city} /> ); }; return ( <div className="text-center"> { this.props.cities.map(renderCity) } </div> ); } }); module.exports = CityLinkList;
const puppeteer = require('puppeteer') const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, terminal: false }); var urls = [] rl.on('line', async (url) => { urls.push(url) }) rl.on('close', async () => { const browser = await puppeteer.launch({ignoreHTTPSErrors: true}) Promise.all(urls.map(url => { return new Promise(async (resolve) => { var page = await browser.newPage() await page.goto(url) var destination = await page.evaluate(() => { return {"domain": document.domain, "href": document.location.href} }) var u = new URL(url) if (u.host != destination.domain){ resolve(`${url} redirects to ${destination.href}`) } else { resolve(null) } }) })).then((values) => { console.log(values.filter(v => v != null).join('\n')) browser.close() }) })
import React from 'react'; import { View, NativeModules, StyleSheet, Dimensions, ScrollView } from 'react-native'; import rnfs from 'react-native-fs'; import { Tabs } from '@ant-design/react-native'; import BaseView from '@/components/common/baseView'; import fileManager from '@/modules/common/fileManager'; import CardInfo from './cardInfo'; const { _PdfViewerApi } = NativeModules; const { width, height } = Dimensions.get('window'); /** * 基础信息 */ const baseInfoField = [ { vmodel: 'EQP_TYPE_NAME', label: '设备种类', type: 'labelInput' }, { vmodel: 'EQP_SORT_NAME', label: '设备列别', type: 'labelInput' }, { vmodel: 'EQP_VART_NAME', label: '设备品种', type: 'labelInput' }, { vmodel: 'EQP_MOD', label: '设备型号', type: 'labelInput' }, { vmodel: 'FACTORY_COD', label: '出厂编号', type: 'labelInput' }, { vmodel: 'SUB_EQP_VART_NAME', label: '子设备品种', type: 'labelInput' }, { vmodel: 'EQP_NAME', label: '设备名称', type: 'labelInput' }, { vmodel: 'EQP_INNER_COD', label: '单位内部编号', type: 'labelInput' }, { vmodel: 'EQP_USE_ADDR', label: '使用地点', type: 'labelInput' }, { vmodel: 'EQP_AREA_COD', label: '安装区域', type: 'labelInput' }, { vmodel: 'EQP_USE_PLACE', label: '设备使用场所', type: 'labelInput' }, { vmodel: 'MAKE_UNT_NAME', label: '制造单位', type: 'labelInput' }, { vmodel: 'MAKE_DATE', label: '制造日期', type: 'labelInput' }, { vmodel: 'MAKE_COUNTRY', label: '制造国', type: 'labelInput' }, { vmodel: 'IMPORT_TYPE', label: '进口类型', type: 'labelInput' }, { vmodel: 'FIRSTUSE_DATE', label: '投入使用日期', type: 'labelInput' }, { vmodel: 'EQP_ISP_DEPT_NAME', label: '检验部门', type: 'labelInput' }, { vmodel: 'EQP_USE_STA_NAME', label: '使用状态', type: 'labelInput' }, { vmodel: 'EQP_USE_OCCA', label: '适用场合', type: 'labelInput' }, { vmodel: 'EQP_USECERT_COD', label: '使用证号', type: 'labelInput' }, { vmodel: 'IF_PUBLIC_AREA', label: '是否公共领域', type: 'labelInput' }, { vmodel: 'IF_NOREG_LEGAR', label: '是否法定非注册设备', type: 'labelInput' }, { vmodel: 'IF_WYL', label: '是否微压炉', type: 'labelInput' }, { vmodel: 'IF_OLDBUILD_INST', label: '是否属于旧楼加装电梯', type: 'labelInput' }, { vmodel: 'EQP_PRICE', label: '设备销售价', type: 'labelInput' }, { vmodel: 'CATLICENNUM', label: '牌照号码', type: 'labelInput' }, { vmodel: 'LAST_BRAKE_TASK_DATE', label: '最后一次制动实验时间', type: 'labelInput' }, { vmodel: 'NEXT_BRAKE_TASK_DATE', label: '下次制动实验时间', type: 'labelInput' }, { vmodel: 'DESIGN_USE_YEAR', label: '使用期限', type: 'labelInput' }, { vmodel: 'DESIGN_USE_OVERYEAR', label: '使用年限到期时间', type: 'labelInput' }, { vmodel: 'IS_MOVEEQP', label: '是否移动设备', type: 'labelInput' }, { vmodel: 'IF_FS_EQP', label: '是否附属设备', type: 'labelInput' }, ]; /** * 使用单位 */ const unitInfoField = [ { vmodel: 'USE_UNT_NAME', label: '使用单位', type: 'labelInput' }, { vmodel: 'USE_UNT_ORGCOD', label: '社会信用代码', type: 'labelInput' }, { vmodel: 'USE_UNT_ADDR', label: '地址', type: 'labelInput' }, { vmodel: 'MGE_DEPT_TYPE_NAME', label: '类型', type: 'labelInput' }, { vmodel: 'USE_LKMEN', label: '使用单位联系人', type: 'labelInput' }, { vmodel: 'USE_MOBILE', label: '使用单位联系手机', type: 'labelInput' }, { vmodel: 'UNT_LKMEN', label: '设备联系人', type: 'labelInput' }, { vmodel: 'UNT_MOBILE', label: '设备联系电话', type: 'labelInput' }, { vmodel: 'UNT_MOBILE', label: '设备联系手机', type: 'labelInput' }, ]; /** * 其他单位 */ const otherUnitField = [ { vmodel: 'MANT_UNT_NAME', label: '维保单位', type: 'labelInput' }, { vmodel: 'MANT_PHONE', label: '维保电话', type: 'labelInput' }, { vmodel: 'MANT_DEPT_NAME', label: '维保部门', type: 'labelInput' }, { vmodel: 'MANT_CYCLE', label: '维保周期', type: 'labelInput' }, { vmodel: 'INST_UNT_NAME', label: '安装单位', type: 'labelInput' }, { vmodel: 'INST_LEADER', label: '安装项目负责任人', type: 'labelInput' }, { vmodel: 'ALT_UNT_NAME', label: '改造单位', type: 'labelInput' }, { vmodel: 'INST_LKPHONE', label: '安装联系电话', type: 'labelInput' }, { vmodel: 'ALT_UNT_NAME', label: '施工单位', type: 'labelInput' }, { vmodel: 'OVH_UNT_NAME', label: '维修单位', type: 'labelInput' }, { vmodel: 'PROP_UNT_NAME', label: '产权单位', type: 'labelInput' }, { vmodel: 'DESIGN_UNT_NAME', label: '设计单位', type: 'labelInput' }, { vmodel: 'TEST_UNT_NAME', label: '型式试验单位', type: 'labelInput' }, { vmodel: 'TEST_REPCOD', label: '型式试验报告编号', type: 'labelInput' }, { vmodel: 'DESIGN_CHKUNT', label: '设计文件鉴定单位', type: 'labelInput' }, ]; /** * 监察相关信息 */ const checkInfoField = [ { vmodel: 'EQP_REG_STA_NAME', label: '注册登记状态', type: 'labelInput' }, { vmodel: 'REG_USER_NAME', label: '注册登记人员', type: 'labelInput' }, { vmodel: 'REG_DATE', label: '注册登记日期', type: 'labelInput' }, { vmodel: 'EQP_REG_COD', label: '注册代码', type: 'labelInput' }, { vmodel: 'REG_UNT_NAME', label: '注册机构', type: 'labelInput' }, { vmodel: 'REG_LOGOUT_DATE', label: '注册登记注销日期', type: 'labelInput' }, { vmodel: 'IF_MAJEQP', label: '是否重要特种设备', type: 'labelInput' }, { vmodel: 'IF_MAJPLACE', label: '是否在重要场所', type: 'labelInput' }, { vmodel: 'IF_MAJCTL', label: '是否重点监控', type: 'labelInput' }, { vmodel: 'IF_POPULATED', label: '是否人口密集区', type: 'labelInput' }, { vmodel: 'IF_IN_PROV', label: '是否省内安装', type: 'labelInput' }, { vmodel: 'IF_SPEC_EQP', label: '是否特殊设备', type: 'labelInput' }, { vmodel: 'EQP_LEVEL', label: '设备等级', type: 'labelInput' }, { vmodel: 'SAFE_LEV', label: '安全评定等级', type: 'labelInput' }, { vmodel: 'ACCI_TYPE', label: '事故隐患类别', type: 'labelInput' }, { vmodel: 'EQP_STATION_COD', label: '设备代码', type: 'labelInput' }, { vmodel: 'EMERGENCY_USER_NAME', label: '应急救援人名', type: 'labelInput' }, { vmodel: 'EMERGENCY_TEL', label: '应急救援电话', type: 'labelInput' }, ]; /** * 检验相关信息 */ const otherCheckField = [ { vmodel: 'LAST_ISP_ID1', label: '上次检验流水号1', type: 'labelInput' }, { vmodel: 'AST_ISPOPE_TYPE1_NAME', label: '上次检验业务类型1', type: 'labelInput' }, { vmodel: 'LAST_ISP_REPORT1', label: '上次检验报告号1', type: 'labelInput' }, { vmodel: 'LAST_ISP_DATE1', label: '上次检验日期1', type: 'labelInput' }, { vmodel: 'LAST_ISP_CONCLU1', label: '上次检验结论1', type: 'labelInput' }, { vmodel: 'LAST_ISP_ID2', label: '上次检验流水号2', type: 'labelInput' }, { vmodel: 'AST_ISPOPE_TYPE2_NAME', label: '上次检验业务类型2', type: 'labelInput' }, { vmodel: 'LAST_ISP_REPORT2', label: '上次检验报告号2', type: 'labelInput' }, { vmodel: 'LAST_ISP_DATE2', label: '上次检验日期2', type: 'labelInput' }, { vmodel: 'LAST_ISP_CONCLU2', label: '上次检验结论2', type: 'labelInput' }, { vmodel: 'NEXT_ISP_DATE1', label: '下次检验日期1', type: 'labelInput' }, { vmodel: 'NEXT_ISP_DATE2', label: '下次检验日期2', type: 'labelInput' }, { vmodel: 'ABNOR_ISP_DATE1', label: '延期检验日期1', type: 'labelInput' }, { vmodel: 'ABNOR_ISP_DATE2', label: '延期检验日期2', type: 'labelInput' }, ]; /** * 技术参数 */ const paramsInfoField = [ { vmodel: 'ELEC_TYPE', label: '电动机(驱动主机)型号', type: 'labelInput' }, { vmodel: 'ELEC_COD', label: '电动机(驱动主机)编号', type: 'labelInput' }, { vmodel: 'CONSCRTYPE', label: '控制屏型号', type: 'labelInput' }, { vmodel: 'CONTSCRCODE', label: '控制屏出厂编号', type: 'labelInput' }, { vmodel: 'RUNVELOCITY', label: '运行速度', type: 'labelInput' }, { vmodel: 'NOMI_WIDTH', label: '名义宽度(自动扶梯/自动人行道)', type: 'labelInput' }, { vmodel: 'DIP_ANGLE', label: '倾斜角度(自动扶梯/自动人行道)', type: 'labelInput' }, { vmodel: 'RATEDLOAD', label: '额定载荷', type: 'labelInput' }, { vmodel: 'ELEHEIGHT', label: '提升高度', type: 'labelInput' }, { vmodel: 'SAFECLAMNUM', label: '安全钳编号', type: 'labelInput' }, { vmodel: 'SAFECLAMTYPE', label: '安全钳型号', type: 'labelInput' }, { vmodel: 'FB_SUBSTANCE', label: '爆炸物质(防爆电梯)', type: 'labelInput' }, { vmodel: 'COMPENTYPE', label: '补偿方式', type: 'labelInput' }, { vmodel: 'FLOORDOORTYPE', label: '层门型号', type: 'labelInput' }, { vmodel: 'BOTTOMDEPTH', label: '底坑深度', type: 'labelInput' }, { vmodel: 'ELECTROPOWER', label: '电动机功率', type: 'labelInput' }, { vmodel: 'ELEC_STYLE', label: '电动机类型', type: 'labelInput' }, { vmodel: 'ELEC_REV', label: '电动机转速', type: 'labelInput' }, { vmodel: 'ELEFLOORNUMBER', label: '电梯层数', type: 'labelInput' }, { vmodel: 'ELEDOORNUMBER', label: '电梯门数', type: 'labelInput' }, { vmodel: 'ELESTADENUMBER', label: '电梯站数', type: 'labelInput' }, { vmodel: 'ELEWALKDISTANCE', label: '电梯走行距离', type: 'labelInput' }, { vmodel: 'TOPHEIGHT', label: '顶层高度', type: 'labelInput' }, { vmodel: 'TOP_PATTERNS', label: '顶升形式(液压电梯)', type: 'labelInput' }, { vmodel: 'COUNORBTYPE', label: '对重导轨型式', type: 'labelInput' }, { vmodel: 'COUP_ORB_DIST', label: '对重轨距', type: 'labelInput' }, { vmodel: 'COUP_NUM', label: '对重块数量', type: 'labelInput' }, { vmodel: 'COUP_LIMIT_COD', label: '对重限速器编号', type: 'labelInput' }, { vmodel: 'COUP_LIMIT_TYPE', label: '对重限速器型号', type: 'labelInput' }, { vmodel: 'RATINGVOLTAGE', label: '额定电流', type: 'labelInput' }, { vmodel: 'RATED_CURRENT', label: '额定电流', type: 'labelInput' }, { vmodel: 'RATINGCURRENT', label: '额定电压', type: 'labelInput' }, { vmodel: 'RATED_PEOPLE', label: '额定载人', type: 'labelInput' }, { vmodel: 'PREVENT_SETTLEMENT', label: '防沉降组合', type: 'labelInput' }, { vmodel: 'LADINCANGLE', label: '扶梯倾斜角', type: 'labelInput' }, { vmodel: 'WORK_LEVL', label: '工作级别', type: 'labelInput' }, { vmodel: 'MANAGEMODE', label: '管理方式', type: 'labelInput' }, { vmodel: 'BUFFERNUMBER', label: '缓冲器编号', type: 'labelInput' }, { vmodel: 'BUFFERTYPE', label: '缓冲器型号', type: 'labelInput' }, { vmodel: 'BUFFERSTYLE', label: '缓冲器形式', type: 'labelInput' }, { vmodel: 'BUFFER_MAKE_UNT', label: '缓冲器制造单位', type: 'labelInput' }, { vmodel: 'CAR_HIGH', label: '轿厢高(杂物电梯)', type: 'labelInput' }, { vmodel: 'CAR_ORB_DIST', label: '轿厢轨距', type: 'labelInput' }, { vmodel: 'CAR_WIDTH', label: '轿厢宽(杂物电梯)', type: 'labelInput' }, { vmodel: 'CAR_UPLIMIT_EV', label: '轿厢上行限速器电气动作速度', type: 'labelInput' }, { vmodel: 'CAR_UPLIMIT_MV', label: '轿厢上行限速器机械动作速度', type: 'labelInput' }, { vmodel: 'CAR_DEEP', label: '轿厢深(杂物电梯)', type: 'labelInput' }, { vmodel: 'CAR_DOWNLIMIT_EV', label: '轿厢下行限速器电气动作速度', type: 'labelInput' }, { vmodel: 'CAR_DOWNLIMIT_MV', label: '轿厢下行限速器机械动作速度', type: 'labelInput' }, { vmodel: 'CAR_PROTECT_COD', label: '轿厢意外移动保护装置编号', type: 'labelInput' }, { vmodel: 'CAR_PROTECT_TYPE', label: '轿厢意外移动保护装置型号', type: 'labelInput' }, { vmodel: 'CAR_DECORATE_STA', label: '轿厢装修状态', type: 'labelInput' }, { vmodel: 'SAFE_DOOR', label: '并道安全门(液压电梯)', type: 'labelInput' }, { vmodel: 'DOOR_OPEN_TYPE', label: '开门方式', type: 'labelInput' }, { vmodel: 'DOOR_OPEN_DIRCT', label: '开门方向(杂物电梯)', type: 'labelInput' }, { vmodel: 'CONTROL_TYPE', label: '控制方式', type: 'labelInput' }, { vmodel: 'LOCK_TYPE', label: '门锁型号(液压电梯)', type: 'labelInput' }, { vmodel: 'FB_AREALEVEL', label: '区域防爆登记(防爆电梯)', type: 'labelInput' }, { vmodel: 'DRIV_APPROACH', label: '驱动方式(杂物电梯)', type: 'labelInput' }, { vmodel: 'SLIDWAY_USE_LENG', label: '人行道使用区段长度(自动人行道)', type: 'labelInput' }, { vmodel: 'UP_PROTECT_MODE', label: '上行保护装置形式', type: 'labelInput' }, { vmodel: 'UP_PROTECT_MODEANDTYPE', label: '上行保护装置形式/型号', type: 'labelInput' }, { vmodel: 'UP_PROTECT_COD', label: '上行超速保护装置编号', type: 'labelInput' }, { vmodel: 'UP_PROTECT_TYPE', label: '上行超速保护装置型号', type: 'labelInput' }, { vmodel: 'UP_RATED_V', label: '上行额定速度(液压电梯)', type: 'labelInput' }, { vmodel: 'DESIGNCRITERION', label: '设计规范', type: 'labelInput' }, { vmodel: 'IF_SHIP', label: '是否船舶电梯', type: 'labelInput' }, { vmodel: 'IF_UNNORMAL', label: '是否非标电梯', type: 'labelInput' }, { vmodel: 'IF_PUB_TRAN', label: '是否公共交通型', type: 'labelInput' }, { vmodel: 'IF_ADDDEVICE', label: '是否加装附加装置', type: 'labelInput' }, { vmodel: 'IF_CAR', label: '是否汽车电梯', type: 'labelInput' }, { vmodel: 'IF_SCANMOBILE', label: '是否手机信号覆盖', type: 'labelInput' }, { vmodel: 'V_PROPOR', label: '速比', type: 'labelInput' }, { vmodel: 'RUNDLEBREADTH', label: '梯级宽度', type: 'labelInput' }, { vmodel: 'DRAG_MODE', label: '拖动方式', type: 'labelInput' }, { vmodel: 'DOWN_RATED_V', label: '下行额定速度(液压电梯)', type: 'labelInput' }, { vmodel: 'RESTSPLEAFACNUMBER', label: '限速器出厂编号', type: 'labelInput' }, { vmodel: 'LIMIT_MV', label: '限速器机械动作速度(液压/杂物电梯)', type: 'labelInput' }, { vmodel: 'LIMIT_ROP_DIA', label: '限速器绳直径', type: 'labelInput' }, { vmodel: 'RESTSPEEDTYPE', label: '限速器型号', type: 'labelInput' }, { vmodel: 'LIMIT_MAKE_UNT', label: '限速器制造单位', type: 'labelInput' }, { vmodel: 'WIRE_ROP_NUM', label: '悬挂钢丝绳数(液压电梯)', type: 'labelInput' }, { vmodel: 'WIRE_ROP_DIA', label: '悬挂钢丝绳直径(液压电梯)', type: 'labelInput' }, { vmodel: 'DRAG_PROPOR', label: '曳引比', type: 'labelInput' }, { vmodel: 'TRACANGLEAFACNUMBER', label: '曳引比出厂编号', type: 'labelInput' }, { vmodel: 'TRACANGTYPE', label: '曳引机型号', type: 'labelInput' }, { vmodel: 'DRAG_PITCH_DIA', label: '曳引轮节径', type: 'labelInput' }, { vmodel: 'DRAG_NUM', label: '曳引绳数', type: 'labelInput' }, { vmodel: 'DRAG_DIA', label: '曳引绳直径', type: 'labelInput' }, { vmodel: 'PUMP_COD', label: '液压泵编号(液压电梯)', type: 'labelInput' }, { vmodel: 'PUMP_POWER', label: '液压泵功率(液压电梯)', type: 'labelInput' }, { vmodel: 'PUMP_FLUX', label: '液压泵流量(液压电梯)', type: 'labelInput' }, { vmodel: 'PUMP_TYPE', label: '液压泵型号(液压电梯)', type: 'labelInput' }, { vmodel: 'PUMP_SPEED', label: '液压泵转速(液压电梯)', type: 'labelInput' }, { vmodel: 'OIL_TYPE', label: '液压油型号(液压电梯)', type: 'labelInput' }, { vmodel: 'CYLINDER_NUM', label: '油缸数量(液压电梯)', type: 'labelInput' }, { vmodel: 'CYLINDER_STYLE', label: '油缸形式(液压电梯)', type: 'labelInput' }, { vmodel: 'RUNMETHOD', label: '运行方法', type: 'labelInput' }, { vmodel: 'FB_MACHINEFLAG', label: '整机防爆标志(防爆电梯)', type: 'labelInput' }, { vmodel: 'FB_HGCOD', label: '整机防爆合格证编号(防爆电梯)', type: 'labelInput' }, { vmodel: 'MANUFACTURECRITERION', label: '制造规范', type: 'labelInput' }, { vmodel: 'MAINSTRFORM', label: '主体结构形式', type: 'labelInput' }, ]; const tabs = [ { title: '设备基础信息', index: 0 }, { title: '检查及校验信息', index: 1 }, { title: '设备技术参数', index: 2 }, ]; /** * 检验任务视图 * * @export * @class DeviceView * @extends {BaseView} */ export default class DeviceView extends BaseView { constructor(props) { super(props); this.state = { data: null, }; } componentDidMount() { this.showHeader(); this._getData(); } _render() { const { data } = this.state; return ( <View style={styles.container}> <Tabs tabs={tabs}> <ScrollView style={styles.content}> {data !== null ? ( <View> <CardInfo fields={baseInfoField} data={data} title={'基本信息'} /> <CardInfo fields={unitInfoField} data={data} title={'使用单位'} /> <CardInfo fields={otherUnitField} data={data} title={'其他单位信息'} /> </View> ) : null} </ScrollView> <ScrollView style={styles.content}> {data !== null ? ( <View> <CardInfo fields={checkInfoField} data={data} title={'监察相关信息'} /> <CardInfo fields={otherCheckField} data={data} title={'检验相关信息'} /> </View> ) : null} </ScrollView> <ScrollView style={styles.content}>{data !== null ? <CardInfo fields={paramsInfoField} data={data} title={'技术参数'} /> : null}</ScrollView> </Tabs> </View> ); } /** * 面板切换 * * @param {*} tabIndex 索引 */ _switchTab(tabIndex) { this.setState({ tabIndex, }); } /** * 获取设备信息 */ async _getData() { const { reportCode } = this.props.route.params; if (typeof reportCode === 'undefined') { this._showHint('该任务无报告号!'); this.props.navigation.goBack(); return; } const path = `${rnfs.ExternalStorageDirectoryPath}/tasks1`; const taskInformation = { reportCode: reportCode, }; const data = await _PdfViewerApi.getInformation(path, JSON.stringify(taskInformation)); if (data === null) { this._showHint('无获取到设备信息,请重新下载任务信息!'); this.goBack(); } this.setState({ data: JSON.parse(data) }); } } const styles = StyleSheet.create({ container: { flex: 1, }, buttonView: { width: width, height: 0.06 * height, padding: 10, }, buttons: { width: '100%', height: '100%', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center' }, button: { marginRight: 5, }, content: { flex: 1, width: '100%', height: height, backgroundColor: '#F0F0F0', }, });
var logo = document.getElementById("signup-logo"); var rollcount = 0; function changeCorners () { if(rollcount == 0){ logo.style.transform = "rotate(360deg)"; logo.style.transition = "2s"; rollcount = 1; } else { logo.style.transform = "rotate(-360deg)"; logo.style.transition = "2s"; rollcount = 0; } } logo.addEventListener("click", changeCorners);
import styled, { createGlobalStyle } from "styled-components"; const GlobalStyle = createGlobalStyle` *,*::after,*::before{ padding: 0; margin: 0; box-sizing: border-box; } :root{ --main-font:'Spartan', sans-serif; --number-font-size:32px; //backgrounds --main-background:${({ theme }) => theme.mainBackground}; --toggle-background:${({ theme }) => theme.toggleBackground}; --keypad-background:${({ theme }) => theme.keypadBackground}; --screen-background:${({ theme }) => theme.screenBackground}; //keys --key-number:${({ theme }) => theme.keyNumber}; --Key-number-shadow:${({ theme }) => theme.KeyNumberShadow}; --key-del-reset:${({ theme }) => theme.keyDelReset}; --key-del-reset-shadow:${({ theme }) => theme.keyDelResetShadow}; --key-equal:${({ theme }) => theme.keyEqual}; --key-equal-shadow:${({ theme }) => theme.keyEqualShadow}; //text --text-dark:${({ theme }) => theme.textDark}; --text-light:${({ theme }) => theme.textLight}; --text-yellow:${({ theme }) => theme.lightYellow}; } html{ font-family:var(--main-font); } body{ transition: .4s; background-color: var(--main-background); } `; export const Container = styled.div` width: 100%; max-width: 600px; margin: 2rem auto; `; export default GlobalStyle;
import ReactDOM from 'react-dom' // Import best-practices css defaults import 'sanitize.css' import 'sanitize.css/typography.css' import 'sanitize.css/forms.css' // Global styling import './global.css' // import root App component import App from './components/App' // Initialize the app on the #app div ReactDOM.render(<App />, document.getElementById('app')) // Enable the service worker when running the build command // if (process.env.NODE_ENV === 'production') { // navigator.serviceWorker.register(`${window.location.origin}/sw.js`) // }
$(document).ready(function(){ 'use strict'; $(document).on('click', '#bookstore2', function(e) { e.preventDefault(); document.title = "Bookstore2"; $('#navbar>a').removeClass(); $('#bookstore2').addClass('selected'); $.ajax({ type: 'get', url: 'bookstore2/shopPage.php', dataType: 'json', success: function(data){ $('#main').children().remove(); $('#main').append(data.html); console.log('Ajax request returned successfully.'); initCart(); } }); }); // Init the shopping cart var initCart = function() { $.ajax({ type: 'post', url: 'bookstore2/shop.php', dataType: 'json', success: function(data){ updateCart(data); console.log('Ajax request returned successfully. Shopping cart initiated.'); }, error: function(jqXHR, textStatus, errorThrown){ console.log('Ajax request failed: ' + textStatus + ', ' + errorThrown); } }); }; // Function to update shopping cart var updateCart = function(data) { $('#content') .html(data.content); $('#numitems') .html(data.numitems); $('#sum') .html(data.sum); $('#status') .html('Shopping cart refreshed.'); $.each(data.items, function(){ console.log('item.'); }); setTimeout(function(){ $('#status') .fadeOut(function(){ $('#status') .html('') .fadeIn(); }); }, 1000); console.log('Shopping cart updated.'); }; // Callback when making a purchase $(document).on('click', '.purchase', function() { var id = $(this).attr('id'); $.ajax({ type: 'post', url: 'bookstore2/shop.php?action=add', data: { itemid: id }, dataType: 'json', success: function(data){ updateCart(data); console.log('Ajax request returned successfully.'); }, error: function(jqXHR, textStatus, errorThrown){ console.log('Ajax request failed: ' + textStatus + ', ' + errorThrown); }, }); console.log('Clicked to buy id: ' + id); }); // Callback to clear all values in shopping cart $(document).on('click', "#clear", function() { $.ajax({ type: 'post', url: 'bookstore2/shop.php?action=clear', dataType: 'json', success: function(data){ updateCart(data); console.log('Ajax request returned successfully.'); }, error: function(jqXHR, textStatus, errorThrown){ console.log('Ajax request failed: ' + textStatus + ', ' + errorThrown); }, }); console.log('Clearing shopping cart.'); }); $(document).on('click', '#checkout', function(){ //Get the html for the checkout page var sum = $('#sum').text(); console.log(sum); $.ajax({ type: 'get', data: 'sum=' + sum, url: 'bookstore2/checkoutPage.php', dataType: 'json', success: function(data){ $('#main').children().remove(); $('#main').append(data.html); console.log('Ajax request returned successfully.'); } }); // Get the sum from the shopping cart $.ajax({ type: 'post', url: 'bookstore2/checkout.php?action=sum', dataType: 'json', success: function(data){ $('#sum') .html(data.sum); console.log('Ajax request returned successfully. Sum updated.'); }, error: function(jqXHR, textStatus, errorThrown){ console.log('Ajax request failed: ' + textStatus + ', ' + errorThrown); } }); }); /** * Check if form is valid */ $(document).on('submit', '#form1', function(event) { var theForm = $('#form1'); var formData = theForm.serialize(); //formData.push({ name: 'doPay', value: true }); console.log("Form: " + formData); console.log('form submitted, preventing default event'); event.preventDefault(); $('#output') .removeClass() .addClass('working') .html('<img src="http://dbwebb.se/img/loader.gif"/> Doing payment, please wait and do NOT reload this page...'); $.ajax({ type: 'post', url: 'bookstore2/checkout.php?action=pay', data: formData, dataType: 'json', success: function(data){ var errors = ''; $.each(data.errors || [], function(index, error) { errors += '<p>' + error.label + ' ' + error.message + '</p>'; }); $('#output') .removeClass() .addClass(data.outputClass) .html('<p>' + data.output + '</p>' + errors); $('#sum') .html(data.sum); console.log('Ajax request returned successfully. ' + data); }, error: function(jqXHR, textStatus, errorThrown){ console.log('Ajax request failed: ' + textStatus + ', ' + errorThrown); } }); console.log('Form submitted, lets wait for a response.'); }); console.log('Ready to roll.'); });
var G_CONTROL_SELECT_OBJECT; var G_CONTROL_MULTISELECT = false; function _onControlCommonChange(e) { if (!G_CONTROL_MULTISELECT && G_CONTROL_SELECT_OBJECT) { var style = $(this).attr('data-style'); var id = $(this).attr('id'); var val = $(this).val(); switch (id) { case 'el-attr-common-id': $(G_CONTROL_SELECT_OBJECT).IObject('id', val); break; } } } function controlInit() { $(document).on(EVT_CHANGE, '.el-attr .el-attr-common-datafield', _onControlCommonChange); $(document).on(EVT_CHANGE, '.el-attr .el-attr-layout-datafield', _onControlLayoutChange); $(document).on(EVT_CHANGE, '.el-attr .el-attr-style-datafield', _onControlStyleChange); $(document).on(EVT_MOUSECLICK, '.el-attr #el-attr-style #el-attr-style-background-image-select', _onControlStyleClickBackgroundImageSelect); $(document).on(EVT_MOUSECLICK, '.el-attr #el-attr-style #el-attr-style-background-image-clear', _onControlStyleClickBackgroundImageClear); controlSetObject(); } function controlSetObject() { if ($('.editor-area .object.selected').length > 1) { G_CONTROL_SELECT_OBJECT = $('.editor-area .object.selected'); G_CONTROL_MULTISELECT = true; $('.el-attr #el-attr-common #el-attr-common-id').val(MESSAGE['G_CONTROL_MULTISELECT_OBJID']); $('.el-attr #el-attr-common #el-attr-common-type').val(MESSAGE['G_CONTROL_MULTISELECT_OBJID']); $('.el-attr .el-attr-common-datafield').attr('disabled', true); } else if ($('.editor-area .object.selected').length == 1) { G_CONTROL_SELECT_OBJECT = $('.editor-area .object.selected'); G_CONTROL_MULTISELECT = false; $('.el-attr #el-attr-common #el-attr-common-id').val(G_CONTROL_SELECT_OBJECT.IObject('id')); switch (G_CONTROL_SELECT_OBJECT.IObject('getType')) { case OBJECT_TYPE_BOX: $('.el-attr #el-attr-common #el-attr-common-type').val(MESSAGE['OBJECT_BOX']); break; case OBJECT_TYPE_TEXT: $('.el-attr #el-attr-common #el-attr-common-type').val(MESSAGE['OBJECT_TEXT']); break; case OBJECT_TYPE_IMAGE: $('.el-attr #el-attr-common #el-attr-common-type').val(MESSAGE['OBJECT_IMAGE']); break; case OBJECT_TYPE_VIDEO: $('.el-attr #el-attr-common #el-attr-common-type').val(MESSAGE['OBJECT_VIDEO']); break; case OBJECT_TYPE_AUDIO: $('.el-attr #el-attr-common #el-attr-common-type').val(MESSAGE['OBJECT_AUDIO']); break; default: $('.el-attr #el-attr-common #el-attr-common-type').val(''); break; } $('.el-attr .el-attr-common-datafield').removeAttr('disabled', true); $('.el-attr button').removeAttr('disabled'); } else { G_CONTROL_SELECT_OBJECT = undefined; G_CONTROL_MULTISELECT = false; $('.el-attr #el-attr-common #el-attr-common-id').val(''); $('.el-attr #el-attr-common #el-attr-common-type').val(''); $('.el-attr .el-attr-common-datafield').attr('disabled', true); $('.el-attr button').attr('disabled', true); } controlLayoutSetObject(); controlStyleSetObject(); controlStyleResetAnimationName(); }
import React from 'react'; import { Component } from 'react'; import TabsPanel from './TabsPanel'; class Tab extends Component{ render(){ const {id, deleteTab} = this.props; return( <div> <input className="tab-input" name="tabbed" id={"tab_" + id} type="radio" defaultChecked/> <label className="tab" htmlFor={"tab_" + id}><span className="tab-label">{"TAB " + id}</span><span onClick={this.deleteSelectedTab} className="close-tab">X</span></label> {this.props.children} </div> ); } } export default Tab;
const { User } = require('models'); const _ = require('lodash'); const makeCountPipeline = ({ string }) => [ { $match: { name: { $regex: `^${string}`, $options: 'i' } } }, { $count: 'count' }, ]; exports.searchUsers = async ({ string, limit, skip }) => { const { user } = await User.getOne(string); const { users, error } = await User.search({ string, skip, limit }); const { result: [ { count: usersCount = 0 } = {}] = [], error: countError, } = await User.aggregate(makeCountPipeline({ string })); if (user && users.length) { _.remove(users, (person) => user.name === person.name); users.splice(0, 0, user); } return { users: _.take(users.map((u) => ( { account: u.name, wobjects_weight: u.wobjects_weight, followers_count: u.followers_count, })), limit), usersCount, error: error || countError, }; };
import styled, { createGlobalStyle } from 'styled-components'; //1rem = 10px 10px/16px = 62.5% const GlobalStyle = createGlobalStyle` html { font-size: 62.5%; } body { &.modal-open { overflow: hidden; } } `; const HeaderContainer = styled.header` text-transform: uppercase; font-size: 5rem; background-color: black; color: white; text-align: center; margin-bottom: 2rem; `; export { GlobalStyle, HeaderContainer, };
var webdriver = require('selenium-webdriver'); var chrome = require('selenium-webdriver/chrome'); var path = require('chromedriver').path; var sd = require('silly-datetime'); var service = new chrome.ServiceBuilder(path).build(); chrome.setDefaultService(service); let By = webdriver.By let assert = require('assert') const login = function (driver, username, password) { driver.findElement(By.xpath('//*[@id="login-box"]/form/div[1]/div/div/input')).sendKeys(username).then( () => { driver.findElement(By.id('ps')).sendKeys(password).then( () => { driver.findElement(By.xpath('//*[@id="login-box"]/div[1]/button')).click() } ) } ) } module.exports = login
import React from "react" import { View, Image, ImageBackground, TouchableOpacity, Text, Button, Switch, TextInput, StyleSheet, ScrollView } from "react-native" import Icon from "react-native-vector-icons/FontAwesome" import { CheckBox } from "react-native-elements" import { connect } from "react-redux" import { widthPercentageToDP as wp, heightPercentageToDP as hp } from "react-native-responsive-screen" import { getNavigationScreen } from "@screens" export class Blank extends React.Component { constructor(props) { super(props) this.state = {} } render = () => ( <ScrollView contentContainerStyle={{ flexGrow: 1 }} style={styles.ScrollView_1} > <View style={styles.View_2} /> <View style={styles.View_1175_5983} /> <View style={styles.View_1175_5984}> <Text style={styles.Text_1175_5984}>80</Text> </View> <View style={styles.View_1175_5985}> <Text style={styles.Text_1175_5985}>$</Text> </View> <View style={styles.View_1175_5986}> <Text style={styles.Text_1175_5986}>How much?</Text> </View> <View style={styles.View_1175_5987}> <View style={styles.View_I1175_5987_654_33}> <View style={styles.View_I1175_5987_654_34}> <ImageBackground source={{ uri: "https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/98c6/6b57/0b0e789e64a5f61427be44aa42d2ff87" }} style={styles.ImageBackground_I1175_5987_654_34_280_5123} /> </View> <View style={styles.View_I1175_5987_654_35}> <Text style={styles.Text_I1175_5987_654_35}>Expense</Text> </View> <View style={styles.View_I1175_5987_654_36}> <ImageBackground source={{ uri: "https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/70ae/2a4b/fd6769519d3a07ece3697035b08fd0ba" }} style={styles.ImageBackground_I1175_5987_654_36_280_12186} /> </View> </View> </View> <View style={styles.View_1175_5988}> <View style={styles.View_1175_5989}> <View style={styles.View_1175_5990}> <View style={styles.View_1175_5991}> <View style={styles.View_1175_5992}> <View style={styles.View_1175_5993}> <View style={styles.View_1175_5994}> <ImageBackground source={{ uri: "https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/62c6/d87a/0bf84ae40e142be53ba658f70ecb36b8" }} style={styles.ImageBackground_1175_5995} /> <View style={styles.View_1175_5996}> <Text style={styles.Text_1175_5996}>Subcription</Text> </View> </View> </View> <View style={styles.View_1175_5997}> <ImageBackground source={{ uri: "https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/4703/cc2e/f711f2fdc6b7e34cb2e41771efaff746" }} style={styles.ImageBackground_I1175_5997_280_5102} /> </View> </View> </View> <View style={styles.View_1175_5998}> <View style={styles.View_I1175_5998_782_170}> <View style={styles.View_I1175_5998_782_171}> <View style={styles.View_I1175_5998_782_172}> <Text style={styles.Text_I1175_5998_782_172}> Disney+ annual subcription </Text> </View> </View> </View> </View> <View style={styles.View_1175_5999}> <View style={styles.View_I1175_5999_809_299}> <View style={styles.View_I1175_5999_809_300}> <Text style={styles.Text_I1175_5999_809_300}>Paypal</Text> </View> <View style={styles.View_I1175_5999_809_301}> <ImageBackground source={{ uri: "https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/6f33/fa2c/3a527f9c99b883ee4edd0fb5b9830ebd" }} style={styles.ImageBackground_I1175_5999_809_301_280_5102} /> </View> </View> </View> <ImageBackground source={{ uri: "https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/3920/9c5e/c2584a8d7e95646cd6ac1009f842fdfa" }} style={styles.ImageBackground_1175_6000} /> <View style={styles.View_1175_6001}> <View style={styles.View_1175_6002}> <View style={styles.View_I1175_6002_812_4381}> <View style={styles.View_I1175_6002_812_4382}> <Text style={styles.Text_I1175_6002_812_4382}> Repeated </Text> </View> <View style={styles.View_I1175_6002_812_4383}> <Text style={styles.Text_I1175_6002_812_4383}> Description </Text> </View> </View> <TouchableOpacity style={styles.TouchableOpacity_I1175_6002_812_4384} onPress={() => this.props.navigation.navigate( getNavigationScreen("701_3102") ) } > <View style={styles.View_I1175_6002_812_4384_701_3113} /> <View style={styles.View_I1175_6002_812_4384_701_3114} /> </TouchableOpacity> </View> <View style={styles.View_1175_6003}> <View style={styles.View_1175_6004}> <View style={styles.View_1175_6005}> <View style={styles.View_1175_6006}> <Text style={styles.Text_1175_6006}>Frequency</Text> </View> <View style={styles.View_1175_6007}> <Text style={styles.Text_1175_6007}> Yearly - December 29 </Text> </View> </View> <View style={styles.View_1175_6008}> <View style={styles.View_1175_6009}> <Text style={styles.Text_1175_6009}>End After</Text> </View> <View style={styles.View_1175_6010}> <Text style={styles.Text_1175_6010}> 29 December 2025 </Text> </View> </View> </View> <View style={styles.View_1175_6011}> <View style={styles.View_I1175_6011_802_4396}> <Text style={styles.Text_I1175_6011_802_4396}>Edit</Text> </View> </View> </View> </View> </View> </View> </View> <View style={styles.View_1175_6012}> <View style={styles.View_1175_6013} /> <View style={styles.View_1175_6014}> <View style={styles.View_I1175_6014_568_4137}> <Text style={styles.Text_I1175_6014_568_4137}>Continue</Text> </View> </View> </View> <View style={styles.View_1175_6015}> <View style={styles.View_I1175_6015_816_117}> <View style={styles.View_I1175_6015_816_118}> <Text style={styles.Text_I1175_6015_816_118}>9:41</Text> </View> </View> <View style={styles.View_I1175_6015_816_119}> <View style={styles.View_I1175_6015_816_120}> <View style={styles.View_I1175_6015_816_121}> <ImageBackground source={{ uri: "https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/42fe/75df/eee86effef9007e53d20453d65f0d730" }} style={styles.ImageBackground_I1175_6015_816_122} /> <ImageBackground source={{ uri: "https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/323b/7a56/3bd8d761d4d553ed17394f5c34643bfe" }} style={styles.ImageBackground_I1175_6015_816_125} /> </View> <View style={styles.View_I1175_6015_816_126} /> </View> <View style={styles.View_I1175_6015_816_127}> <View style={styles.View_I1175_6015_816_128} /> <View style={styles.View_I1175_6015_816_129} /> <View style={styles.View_I1175_6015_816_130} /> <View style={styles.View_I1175_6015_816_131} /> </View> <ImageBackground source={{ uri: "https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/2e76/21a5/ca49045f4b39546b3cfd31fde18b9385" }} style={styles.ImageBackground_I1175_6015_816_132} /> </View> </View> <View style={styles.View_1175_6016}> <View style={styles.View_I1175_6016_217_6977} /> </View> <View style={styles.View_1175_6073}> <View style={styles.View_I1175_6073_769_3805} /> </View> <View style={styles.View_1175_6075}> <View style={styles.View_1175_6076} /> <View style={styles.View_1175_6077}> <View style={styles.View_1175_6078}> <Text style={styles.Text_1175_6078}> Transaction has been successfully added </Text> </View> <View style={styles.View_1175_6079}> <ImageBackground source={{ uri: "https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/9712/d9fd/41a06f2b5b9e4a0e0d0f7a11a978939f" }} style={styles.ImageBackground_I1175_6079_280_4541} /> </View> </View> </View> </ScrollView> ) } const styles = StyleSheet.create({ ScrollView_1: { backgroundColor: "rgba(255, 255, 255, 1)" }, View_2: { height: hp("125%") }, View_1175_5983: { width: wp("100%"), minWidth: wp("100%"), height: hp("125%"), minHeight: hp("125%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(253, 60, 74, 1)" }, View_1175_5984: { width: wp("22%"), minWidth: wp("22%"), minHeight: hp("11%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("18%"), top: hp("27%"), justifyContent: "flex-start" }, Text_1175_5984: { color: "rgba(252, 252, 252, 1)", fontSize: 51, fontWeight: "400", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_1175_5985: { width: wp("11%"), minWidth: wp("11%"), minHeight: hp("11%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("7%"), top: hp("27%"), justifyContent: "flex-start" }, Text_1175_5985: { color: "rgba(252, 252, 252, 1)", fontSize: 51, fontWeight: "400", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_1175_5986: { width: wp("27%"), minWidth: wp("27%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("7%"), top: hp("23%"), justifyContent: "flex-start" }, Text_1175_5986: { color: "rgba(252, 252, 252, 1)", fontSize: 14, fontWeight: "400", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_1175_5987: { width: wp("100%"), minWidth: wp("100%"), height: hp("9%"), minHeight: hp("9%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("6%"), backgroundColor: "rgba(0, 0, 0, 0)" }, View_I1175_5987_654_33: { flexGrow: 1, width: wp("91%"), height: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("2%"), backgroundColor: "rgba(0, 0, 0, 0)" }, View_I1175_5987_654_34: { width: wp("9%"), minWidth: wp("9%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(0, 0, 0, 0)", overflow: "hidden" }, ImageBackground_I1175_5987_654_34_280_5123: { flexGrow: 1, width: wp("6%"), height: hp("2%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("1%"), top: hp("1%") }, View_I1175_5987_654_35: { width: wp("66%"), minWidth: wp("66%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("13%"), top: hp("0%"), justifyContent: "center" }, Text_I1175_5987_654_35: { color: "rgba(255, 255, 255, 1)", fontSize: 14, fontWeight: "400", textAlign: "center", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_I1175_5987_654_36: { width: wp("9%"), minWidth: wp("9%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("83%"), top: hp("0%"), backgroundColor: "rgba(0, 0, 0, 0)", overflow: "hidden" }, ImageBackground_I1175_5987_654_36_280_12186: { flexGrow: 1, width: wp("6%"), height: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("1%"), top: hp("1%") }, View_1175_5988: { width: wp("100%"), minWidth: wp("100%"), height: hp("69%"), minHeight: hp("69%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("40%"), backgroundColor: "rgba(255, 255, 255, 1)" }, View_1175_5989: { width: wp("91%"), minWidth: wp("91%"), height: hp("64%"), minHeight: hp("64%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("3%"), backgroundColor: "rgba(0, 0, 0, 0)" }, View_1175_5990: { width: wp("91%"), minWidth: wp("91%"), height: hp("64%"), minHeight: hp("64%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(0, 0, 0, 0)" }, View_1175_5991: { width: wp("91%"), minWidth: wp("91%"), height: hp("8%"), minHeight: hp("8%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(255, 255, 255, 1)" }, View_1175_5992: { width: wp("83%"), minWidth: wp("83%"), height: hp("5%"), minHeight: hp("5%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("2%"), backgroundColor: "rgba(0, 0, 0, 0)" }, View_1175_5993: { width: wp("33%"), minWidth: wp("33%"), height: hp("5%"), minHeight: hp("5%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(252, 252, 252, 1)" }, View_1175_5994: { width: wp("26%"), minWidth: wp("26%"), height: hp("2%"), minHeight: hp("2%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("2%"), top: hp("1%"), backgroundColor: "rgba(0, 0, 0, 0)" }, ImageBackground_1175_5995: { width: wp("4%"), minWidth: wp("4%"), height: hp("2%"), minHeight: hp("2%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%") }, View_1175_5996: { width: wp("21%"), minWidth: wp("21%"), minHeight: hp("2%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("6%"), top: hp("0%"), justifyContent: "flex-start" }, Text_1175_5996: { color: "rgba(33, 35, 37, 1)", fontSize: 11, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_1175_5997: { width: wp("9%"), minWidth: wp("9%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("74%"), top: hp("0%"), backgroundColor: "rgba(0, 0, 0, 0)", overflow: "hidden" }, ImageBackground_I1175_5997_280_5102: { flexGrow: 1, width: wp("5%"), height: hp("1%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("2%"), top: hp("2%") }, View_1175_5998: { width: wp("91%"), minWidth: wp("91%"), height: hp("8%"), minHeight: hp("8%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("10%"), backgroundColor: "rgba(255, 255, 255, 1)" }, View_I1175_5998_782_170: { flexGrow: 1, width: wp("83%"), height: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("2%"), backgroundColor: "rgba(0, 0, 0, 0)" }, View_I1175_5998_782_171: { width: wp("83%"), minWidth: wp("83%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(0, 0, 0, 0)" }, View_I1175_5998_782_172: { width: wp("77%"), minWidth: wp("77%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), justifyContent: "center" }, Text_I1175_5998_782_172: { color: "rgba(13, 14, 15, 1)", fontSize: 13, fontWeight: "400", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_1175_5999: { width: wp("91%"), minWidth: wp("91%"), height: hp("8%"), minHeight: hp("8%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("20%"), backgroundColor: "rgba(255, 255, 255, 1)" }, View_I1175_5999_809_299: { flexGrow: 1, width: wp("83%"), height: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("2%"), backgroundColor: "rgba(0, 0, 0, 0)" }, View_I1175_5999_809_300: { width: wp("14%"), minWidth: wp("14%"), minHeight: hp("2%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("1%"), justifyContent: "flex-start" }, Text_I1175_5999_809_300: { color: "rgba(13, 14, 15, 1)", fontSize: 13, fontWeight: "400", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_I1175_5999_809_301: { width: wp("9%"), minWidth: wp("9%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("74%"), top: hp("0%"), backgroundColor: "rgba(0, 0, 0, 0)", overflow: "hidden" }, ImageBackground_I1175_5999_809_301_280_5102: { flexGrow: 1, width: wp("5%"), height: hp("1%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("2%"), top: hp("2%") }, ImageBackground_1175_6000: { width: wp("30%"), minWidth: wp("30%"), height: hp("15%"), minHeight: hp("15%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("30%") }, View_1175_6001: { width: wp("91%"), minWidth: wp("91%"), height: hp("17%"), minHeight: hp("17%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("47%"), backgroundColor: "rgba(0, 0, 0, 0)" }, View_1175_6002: { width: wp("91%"), minWidth: wp("91%"), height: hp("8%"), minHeight: hp("8%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(255, 255, 255, 1)" }, View_I1175_6002_812_4381: { flexGrow: 1, width: wp("59%"), height: hp("5%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("1%"), backgroundColor: "rgba(0, 0, 0, 0)" }, View_I1175_6002_812_4382: { width: wp("20%"), minWidth: wp("20%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), justifyContent: "flex-start" }, Text_I1175_6002_812_4382: { color: "rgba(41, 43, 45, 1)", fontSize: 13, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_I1175_6002_812_4383: { width: wp("59%"), minWidth: wp("59%"), minHeight: hp("2%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("3%"), justifyContent: "flex-start" }, Text_I1175_6002_812_4383: { color: "rgba(145, 145, 159, 1)", fontSize: 10, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, TouchableOpacity_I1175_6002_812_4384: { flexGrow: 1, width: wp("11%"), height: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("80%"), top: hp("2%"), backgroundColor: "rgba(0, 0, 0, 0)" }, View_I1175_6002_812_4384_701_3113: { flexGrow: 1, width: wp("11%"), height: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(127, 61, 255, 1)" }, View_I1175_6002_812_4384_701_3114: { flexGrow: 1, width: wp("5%"), height: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("5%"), top: hp("0%"), backgroundColor: "rgba(252, 252, 252, 1)" }, View_1175_6003: { width: wp("91%"), minWidth: wp("91%"), height: hp("8%"), minHeight: hp("8%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("9%"), backgroundColor: "rgba(255, 255, 255, 1)" }, View_1175_6004: { width: wp("75%"), minWidth: wp("75%"), height: hp("5%"), minHeight: hp("5%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("1%"), backgroundColor: "rgba(0, 0, 0, 0)" }, View_1175_6005: { width: wp("36%"), minWidth: wp("36%"), height: hp("5%"), minHeight: hp("5%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(0, 0, 0, 0)" }, View_1175_6006: { width: wp("36%"), minWidth: wp("36%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), justifyContent: "flex-start" }, Text_1175_6006: { color: "rgba(41, 43, 45, 1)", fontSize: 13, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_1175_6007: { width: wp("36%"), minWidth: wp("36%"), minHeight: hp("2%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("3%"), justifyContent: "flex-start" }, Text_1175_6007: { color: "rgba(145, 145, 159, 1)", fontSize: 10, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_1175_6008: { width: wp("36%"), minWidth: wp("36%"), height: hp("5%"), minHeight: hp("5%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("38%"), top: hp("0%"), backgroundColor: "rgba(0, 0, 0, 0)" }, View_1175_6009: { width: wp("36%"), minWidth: wp("36%"), minHeight: hp("3%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), justifyContent: "flex-start" }, Text_1175_6009: { color: "rgba(41, 43, 45, 1)", fontSize: 13, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_1175_6010: { width: wp("36%"), minWidth: wp("36%"), minHeight: hp("2%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("3%"), justifyContent: "flex-start" }, Text_1175_6010: { color: "rgba(145, 145, 159, 1)", fontSize: 10, fontWeight: "500", textAlign: "left", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_1175_6011: { width: wp("15%"), minWidth: wp("15%"), height: hp("4%"), minHeight: hp("4%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("76%"), top: hp("2%"), backgroundColor: "rgba(238, 229, 255, 1)" }, View_I1175_6011_802_4396: { flexGrow: 1, width: wp("7%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("1%"), justifyContent: "center" }, Text_I1175_6011_802_4396: { color: "rgba(127, 61, 255, 1)", fontSize: 11, fontWeight: "500", textAlign: "center", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_1175_6012: { width: wp("100%"), minWidth: wp("100%"), height: hp("12%"), minHeight: hp("12%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("109%") }, View_1175_6013: { width: wp("100%"), minWidth: wp("100%"), height: hp("12%"), minHeight: hp("12%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(255, 255, 255, 1)" }, View_1175_6014: { width: wp("91%"), minWidth: wp("91%"), height: hp("8%"), minHeight: hp("8%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("2%"), backgroundColor: "rgba(127, 61, 255, 1)" }, View_I1175_6014_568_4137: { flexGrow: 1, width: wp("21%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("35%"), top: hp("2%"), justifyContent: "center" }, Text_I1175_6014_568_4137: { color: "rgba(252, 252, 252, 1)", fontSize: 14, fontWeight: "400", textAlign: "center", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_1175_6015: { width: wp("100%"), minWidth: wp("100%"), height: hp("6%"), minHeight: hp("6%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(0, 0, 0, 0)" }, View_I1175_6015_816_117: { flexGrow: 1, width: wp("14%"), height: hp("2%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("5%"), top: hp("2%") }, View_I1175_6015_816_118: { width: wp("14%"), minWidth: wp("14%"), minHeight: hp("2%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), justifyContent: "flex-start" }, Text_I1175_6015_816_118: { color: "rgba(255, 255, 255, 1)", fontSize: 12, fontWeight: "400", textAlign: "center", fontStyle: "normal", letterSpacing: -0.16500000655651093, textTransform: "none" }, View_I1175_6015_816_119: { flexGrow: 1, width: wp("18%"), height: hp("2%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("78%"), top: hp("2%") }, View_I1175_6015_816_120: { width: wp("7%"), minWidth: wp("7%"), height: hp("2%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("11%"), top: hp("0%") }, View_I1175_6015_816_121: { width: wp("7%"), height: hp("2%"), top: hp("0%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%") }, ImageBackground_I1175_6015_816_122: { width: wp("6%"), minWidth: wp("6%"), height: hp("2%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%") }, ImageBackground_I1175_6015_816_125: { width: wp("0%"), minWidth: wp("0%"), height: hp("1%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("6%"), top: hp("1%") }, View_I1175_6015_816_126: { width: wp("5%"), minWidth: wp("5%"), height: hp("1%"), minHeight: hp("1%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("1%"), top: hp("0%"), backgroundColor: "rgba(255, 255, 255, 1)", borderColor: "rgba(76, 217, 100, 1)", borderWidth: 1 }, View_I1175_6015_816_127: { width: wp("5%"), height: hp("1%"), top: hp("0%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%") }, View_I1175_6015_816_128: { width: wp("1%"), minWidth: wp("1%"), height: hp("1%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("1%"), backgroundColor: "rgba(255, 255, 255, 1)" }, View_I1175_6015_816_129: { width: wp("1%"), minWidth: wp("1%"), height: hp("1%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("1%"), top: hp("1%"), backgroundColor: "rgba(255, 255, 255, 1)" }, View_I1175_6015_816_130: { width: wp("1%"), minWidth: wp("1%"), height: hp("1%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("3%"), top: hp("0%"), backgroundColor: "rgba(255, 255, 255, 1)" }, View_I1175_6015_816_131: { width: wp("1%"), minWidth: wp("1%"), height: hp("1%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("4%"), top: hp("0%"), backgroundColor: "rgba(255, 255, 255, 1)" }, ImageBackground_I1175_6015_816_132: { width: wp("4%"), minWidth: wp("4%"), height: hp("2%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("6%"), top: hp("0%") }, View_1175_6016: { width: wp("100%"), minWidth: wp("100%"), height: hp("5%"), minHeight: hp("5%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("121%"), backgroundColor: "rgba(255, 255, 255, 1)" }, View_I1175_6016_217_6977: { flexGrow: 1, width: wp("36%"), height: hp("1%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("32%"), top: hp("3%"), backgroundColor: "rgba(0, 0, 0, 1)" }, View_1175_6073: { width: wp("100%"), minWidth: wp("100%"), height: hp("125%"), minHeight: hp("125%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(0, 0, 0, 0)" }, View_I1175_6073_769_3805: { flexGrow: 1, width: wp("100%"), height: hp("125%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(13, 14, 15, 1)" }, View_1175_6075: { width: wp("87%"), minWidth: wp("87%"), height: hp("17%"), minHeight: hp("17%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("6%"), top: hp("46%") }, View_1175_6076: { width: wp("87%"), minWidth: wp("87%"), height: hp("17%"), minHeight: hp("17%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("0%"), backgroundColor: "rgba(255, 255, 255, 1)" }, View_1175_6077: { width: wp("75%"), minWidth: wp("75%"), height: hp("12%"), minHeight: hp("12%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("6%"), top: hp("3%") }, View_1175_6078: { width: wp("75%"), minWidth: wp("75%"), minHeight: hp("2%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("0%"), top: hp("10%"), justifyContent: "flex-start" }, Text_1175_6078: { color: "rgba(0, 0, 0, 1)", fontSize: 11, fontWeight: "500", textAlign: "center", fontStyle: "normal", letterSpacing: 0, textTransform: "none" }, View_1175_6079: { width: wp("17%"), minWidth: wp("17%"), height: hp("9%"), minHeight: hp("9%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("29%"), top: hp("0%"), backgroundColor: "rgba(0, 0, 0, 0)", overflow: "hidden" }, ImageBackground_I1175_6079_280_4541: { flexGrow: 1, width: wp("13%"), height: hp("7%"), marginLeft: 0, marginTop: 0, position: "absolute", left: wp("2%"), top: hp("1%") } }) const mapStateToProps = state => { return {} } const mapDispatchToProps = () => { return {} } export default connect(mapStateToProps, mapDispatchToProps)(Blank)
import Gulp from 'gulp'; import Chalk from 'chalk'; import Log from 'fancy-log'; class Fonts { constructor() { Log(Chalk.bgCyan.bold('Initializing Fonts')); this.srcPath = './src/project/fonts/*.{eot,ttf,woff,woff2,svg}'; this.distPath = './dist/fonts'; this.copy = this.copy.bind(this); } copy() { Log(Chalk.cyan('Copying fonts for build')); return Gulp.src(this.srcPath) .pipe(Gulp.dest(this.distPath)); } } export default Fonts;
export const FETCH_POSTS = "FETCH POSTS"; export const ADD_POST = "ADD POST"; export const LOGGED_IN = "LOGGED IN"; export const LOG_OUT = "LOG_OUT"; export const SET_SESSION = "SET SESSION"; export const POSTS_TO_SHOW = "POSTS TO SHOW"; export const INITIAL_POSTS_STATUS = "INITIAL POSTS STATUS"; export const LOAD_DIALOGS = "LOAD DIALOGS"; export const LOAD_MESSAGES = "LOAD MESSAGES"; export const SET_DIALOG_KEY = "SET DIALOG KEY"; export const SET_CURRENT_DIALOG = "SET CURRENT DIALOG"; export const ADD_MY_MESSAGES = "ADD MY MESSAGES"; export const INIT_MY_MESSAGES = "INIT MY MESSAGES"; export const SET_MY_MESSAGES = "SET MY MESSAGES"; export const CHECK_KEYS = "CHECK KEYS"; export const SET_KEYS = "SET KEYS"; export const SET_ERROR = "SET ERROR"; export const GET_LIKES = "GET LIKES"; export const UNSEEN_POSTS_COUNT = "UNSEEN POSTS COUNT"; export const SET_THEME = 'SET THEME'; export const logIn = user => { return ({ type : LOGGED_IN, loggedIn : true, user : user }); }; export const logOut = () => { return ({ type : LOG_OUT, loggedIn : false, user : {} }); }; export const addPost = post => { return ({ type : ADD_POST, post }); }; export const getLikes = likes => { return ({ type : GET_LIKES, likes }); }; export const unseenPostsCount = count => { return ({ type: UNSEEN_POSTS_COUNT, count }); }; export const setPostsLength = ({postsLength}) => { return ({ type : INITIAL_POSTS_STATUS, postsLength }); }; export const showPosts = ({showPosts, showPostStep}) => { return ({ type : POSTS_TO_SHOW, showPosts, showPostStep }) }; export const setUserSession = ({session, user}) => { return ({ session, user, type : SET_SESSION, loggedIn : true }); }; export const loadDialogs = ({dialogs}) => { return ({ type : LOAD_DIALOGS, dialogs }); }; export const loadMessages = msgs => { return ({ type: LOAD_MESSAGES, messages: msgs }); }; export const setCurrentDialog = user => { return ({ type : SET_CURRENT_DIALOG, currentDialog : user }); }; export const addMyMessage = props => { return ({ type: ADD_MY_MESSAGES, id : props.recipient, msgObj : props }); }; export const checkKeys = bool => { return ({ type : CHECK_KEYS, keysChecking : bool }); }; export const setKeys = ({publicKeyB64, privateKeyB64}) => { return ({ type : SET_KEYS, publicKey : publicKeyB64.trim(), privateKey : privateKeyB64.trim() }); }; export const initMyMessages = id => { return ({ type: INIT_MY_MESSAGES, id }); }; export const currentDialogPublicKey = string => { return ({ type : SET_DIALOG_KEY, string }); }; export const setMyMessages = myMessages => { return ({ type: SET_MY_MESSAGES, myMessages }); }; export const setError = error => { return ({ type : SET_ERROR, error }); }; export const setTheme = theme => { return ({ type: SET_THEME, theme, }); };
import { Accounts } from 'meteor/accounts-base'; Accounts.onCreateUser(function (options, user) { if (options.profile) { const { name } = options.profile; user.username = name; user.emails = [{ address: user.services.google.email, verified: false }]; } return user; }); ServiceConfiguration.configurations.remove({ service: "google" }); ServiceConfiguration.configurations.insert({ service: "google", clientId: "430465354630-gbtf7grdk31ovroj1jf0pbn42sc3vn5i.apps.googleusercontent.com", secret: "LwLWihm9suWCsj61JNdXzAIQ" });
import React from 'react' import ImageSlider from '../../ImageSlider'; import IntroCard from '../../IntroCard'; import '../../../App.css'; function London() { return ( <div className='main-container place'> <ImageSlider place='London' /> <IntroCard title='Why Go To London' firstP='The English writer Samuel Johnson famously said, "You find no man, at all intellectual, who is willing to leave London. No, Sir, when a man is tired of London, he is tired of life; for there is in London all that life can afford." More than two centuries have passed since Johnson&apos;s era, but his words still ring true. Life in London is nothing short of invigorating, and travelers find that one visit isn&apos;t enough to experience everything this two-millennia-old city has to offer.' secondP='Here, the antiquated clasps hands with the contemporary. You&apos;ll find the historic Tower of London and the avant-garde Tate Modern both considered must-sees. Shakespeare&apos;s sonnets are still being uttered by actors who don modern garb. Londoners most certainly still respect the royals, but they also jam to the likes of Arctic Monkeys and Adele. And while they still praise the power of tea, they now make room for some Starbucks here and there, and pressed juice too. A current leader in everything from politics and banking to fashion and music, London&apos;s culture compass is always attuned to what&apos;s next. Discover it all on one of London&apos;s best tours.' /> </div> ) } export default London
$(document).ready(function() { $("#ball").addClass("animated bounce"); $("#ball2").addClass("animated shake"); $("#ball3").addClass("animated pulse"); });
import React from 'react'; import axios from 'axios'; import AssetPair from '../js/AssetPair'; class CryptoCurrencies extends React.Component { constructor(props) { super(props); this.state = { data : this.props.data, btceurPrice : 0, pollInterval: this.props.pollInterval, dataEndpointUrl: '/kraken' }; this.loadDataFromServer = this.loadDataFromServer.bind(this) } loadDataFromServer(component, apiUrl) { axios.get(apiUrl).then(function(res) { var dataList = res.data.list; let btceur = dataList.map(function (item) { if(item.pair_name === "XXBTZEUR"){ return item.c[0]; } }); component.setState({ data : dataList, btceurPrice : btceur[2] }); }); } componentDidMount() { this.loadDataFromServer(this, this.state.dataEndpointUrl); setInterval(this.loadDataFromServer.bind(null, this, this.state.dataEndpointUrl), this.state.pollInterval); } render(){ let dataItems = ""; if(this.state.data !== null && this.state.data.length > 0) { let self = this; dataItems = this.state.data.map(function (item) { return <AssetPair btceur={self.state.btceurPrice} data={item} key={item.id} url={self.state.dataEndpointUrl}/> }); } return ( <div> <h5 className="text-center text-muted">Kraken.com</h5> <ul> {dataItems} </ul> </div> ) } } export default CryptoCurrencies;
import React, { useState } from "react"; import "./layout.css"; import moment from "moment"; import ReactDatePicker from "react-datepicker"; import Modal from "react-bootstrap/Modal"; import { Button } from "react-bootstrap"; import { useDispatch } from "react-redux"; import { createTask } from "../../redux/actions/task"; const TaskModal = ({ id, show, handleClose, users, handleShow }) => { const dispatch = useDispatch(); const [task, setTask] = useState({ task_name: "", duration: "", start_date: "", description: "", user_id: "", }); const onChange = (e) => { const { name, value } = e.target; setTask((prev) => ({ ...prev, [name]: value })); }; const addTask = () => { const task_to_add = { ...task, project_id: id, status: "ongoing" }; dispatch(createTask(task_to_add)); reseTask(); handleClose(); }; const reseTask = () => { setTask({ task_name: "", duration: "", start_date: "", description: "", user_id: "", }); }; const minDate = moment(); return ( <> <Modal show={show} onHide={() => { reseTask(); handleClose(); }} > <Modal.Header closeButton> <Modal.Title>Add New Task </Modal.Title> </Modal.Header> <Modal.Body> <div className="newTask"> <form className="addTaskForm"> <div className="addTaskItem"> <lable>Task name </lable> <input type="text" name="task_name" id="name" placeholder="enter Task name" autoComplete="off" value={task.task_name} onChange={onChange} /> </div> <div className="addTaskItem"> <lable> Start Date </lable> <ReactDatePicker name="date" id="date" value={task.start_date} autoComplete="off" dateFormat="dd/MM/yyyy" selected={task.start_date} minDate={minDate} onChange={(date) => setTask({ ...task, start_date: date })} filterDate={(date) => date.getDay() !== 6 && date.getDay() !== 0 } isClearable showYearDropdown scrollableYearDropdown /> </div> <div className="addTaskItem"> <lable> Duration </lable> <input type="text" name="duration" id="duration" placeholder="enter duration" autoComplete="off" value={task.duration} onChange={onChange} /> </div> <div className="addProjectItem"> <lable> Description </lable> <input type="text" name="description" id="description" placeholder="enter description" autoComplete="off" value={task.description} onChange={onChange} /> </div> <div className="addProjectItem"> <lable> User </lable> <select value={task.user_id} onChange={onChange} name="user_id"> <option>Choose user to undertake Task</option> {users?.map((user) => ( <option value={user?.id}> {user?.username} {user?.full_name} </option> ))} </select> </div> </form> </div> </Modal.Body> <Modal.Footer> <Button variant="secondary" onClick={() => { reseTask(); handleClose(); }} > Close </Button> <Button variant="primary" onClick={addTask}> Create task </Button> </Modal.Footer> </Modal> </> ); }; export default TaskModal;
const environmentUrls = new Map(); environmentUrls.set('localhost','http://localhost:8080'); environmentUrls.set('bookstore-demo-client.herokuapp.com','https://bookstore-demo-client.herokuapp.com'); export default environmentUrls.get(window.location.hostname);
import Layout from "./components/Layout"; import Form from "./components/Forms/Form"; import {MuiPickersUtilsProvider} from "@material-ui/pickers"; import MomentUtils from "@date-io/moment"; import {applyMiddleware, combineReducers, createStore, compose} from "redux"; import ReduxThunk from "redux-thunk"; import {Provider} from "react-redux"; import athleteReducer from "./store/reducers/athleteReducer"; const rootReducer = combineReducers({ athlete: athleteReducer, }); const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE_ || compose; const store = createStore(rootReducer, composeEnhancers(applyMiddleware(ReduxThunk))); function App() { return ( <Provider store={store}> <MuiPickersUtilsProvider utils={MomentUtils}> <div> <Layout> <Form /> </Layout> </div> </MuiPickersUtilsProvider> </Provider> ); } export default App;
module.exports = { home: require('./home_controller'), user: require('./user_controller'), product: require('./product_controller'), admin: require('./admin_controller'), };
// app/models/user.js // load the things we need var mongoose = require('mongoose'); var bcrypt = require('bcrypt-nodejs'); // define the schema for our user model var userSchema = mongoose.Schema({ local : { email : String, id_social : String, name : String, birthday: String, job: String, gender:String, hometown:String, education: String, image : String, cover : String, password : String, }, followers:[{userId:String,image:String,name:String}], group:[{id:String,name:String,cover:String}], addfriend:[], notify:[{id:String,image:String,name: String,title: String,id_status:String,action:String,date: {type: Date, default: Date.now}}], message:[{id:String,image:String,name: String,content: String,date: {type: Date, default: Date.now},seen:String}] }); // methods ====================== // generating a hash userSchema.methods.generateHash = function(password) { return bcrypt.hashSync(password, bcrypt.genSaltSync(8), null); }; // checking if password is valid userSchema.methods.validPassword = function(password) { return bcrypt.compareSync(password, this.local.password); }; // create the model for users and expose it to our app module.exports = mongoose.model('User', userSchema);
const assert = require('power-assert'); const { todo, sequelize } = require('../../../src/db/models'); const requestHelper = require('../../helper/requestHelper'); const chalk = require('chalk'); const getTodos = async () => { const response = await requestHelper.request({ method: 'get', endPoint: '/api/todos', statusCode: 200 }); return response.body.data; }; describe(chalk.green('test_DELETE_/api/todos'), () => { before(async () => { const promises = []; for (let i = 0; i < 5; i++) { const todoData = { title: 'test title' + i, body: 'test body' + i }; const promise = todo.create(todoData); promises.push(promise); } await Promise.all(promises); }); after(async () => { await sequelize.truncate(); }); it('test of response 200', async () => { const initTodos = await getTodos(); assert.strictEqual(initTodos.length, 5); const deleteId = initTodos[0].id; const response = await requestHelper.request({ method: 'delete', endPoint: `/api/todos/${deleteId}`, statusCode: 200 }); const deletedTodo = response.body.data; assert.strictEqual(typeof deletedTodo, 'object'); assert.strictEqual(typeof deletedTodo.id, 'number'); assert.strictEqual(typeof deletedTodo.title, 'string'); assert.strictEqual(typeof deletedTodo.body, 'string'); assert.strictEqual(typeof deletedTodo.completed, 'boolean'); assert.strictEqual(typeof deletedTodo.createdAt, 'string'); assert.strictEqual(typeof deletedTodo.updatedAt, 'string'); assert.deepStrictEqual({ ...deletedTodo }, { id: deletedTodo.id, title: deletedTodo.title, body: deletedTodo.body, completed: deletedTodo.completed, createdAt: deletedTodo.createdAt, updatedAt: deletedTodo.updatedAt }); await requestHelper.request({ method: 'get', endPoint: `/api/todos/${deleteId}`, statusCode: 404 }); }); it('error if ID is invalid', async () => { const initTodos = await getTodos(); const INVALID_ID = initTodos[3].id + 1; const response = await requestHelper.request({ method: 'delete', endPoint: `/api/todos/${INVALID_ID}`, statusCode: 404 }); assert.deepStrictEqual(response.body.error.message, `Could not find a ID:${INVALID_ID}`); }); });
'use strict'; const {cloneDeep} = require('lodash'); const path = require('path'); module.exports = function({defaultLang = 'en', locales = ['ja']} = {}) { const allLangs = [ { lang: defaultLang, langDir: '', }, ...locales.map((lang) => ({ lang, langDir: `${lang}/`, })) ]; return (files, metalsmith, done) => { /** * Find the files in each collection. */ Object.keys(files).filter((file) => path.extname(file) === '.hbs').forEach((file) => { const data = files[file]; data.allLangs = allLangs; allLangs.forEach(({lang, langDir}) => { const newName = path.join(langDir, file); const newData = cloneDeep(data, (value) => { if (value instanceof Buffer) { return Buffer.from(value); } return value; }); newData[`lang_${lang}`] = true; newData.lang = lang; newData.langDir = langDir; newData.originalPath = file.replace(/\\/g, '/'); files[newName] = newData; }); }); done(); }; };
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (factory((global.oan = {}))); }(this, (function (exports) { 'use strict'; var App = {}; //# sourceMappingURL=app.js.map var Dep = /** @class */ (function () { function Dep() { this.deps = []; } Dep.prototype.addDep = function (watcher) { if (watcher) { this.deps.push(watcher); } }; Dep.prototype.notify = function () { this.deps.forEach(function (watcher) { watcher.update(); }); }; return Dep; }()); //# sourceMappingURL=Dep.js.map var Watcher = /** @class */ (function () { function Watcher(vm, node, name, nodeType) { Dep.target = this; this.name = name; this.node = node; this.vm = vm; this.nodeType = nodeType; this.update(); Dep.target = null; } Watcher.prototype.get = function () { this.value = this.vm[this.name]; }; Watcher.prototype.update = function () { this.get(); if (this.nodeType === 'text') { this.node.nodeValue = this.value; } if (this.nodeType === 'input') { this.node.value = this.value; } if (this.nodeType === 'p') { this.node.innerHTML = this.value; } }; return Watcher; }()); //# sourceMappingURL=Watcher.js.map function Observe(obj, vm) { Object.keys(obj).forEach(function (key) { defineReactive(vm, key, obj[key]); }); } function defineReactive(obj, key, val) { var dep = new Dep(); Object.defineProperty(obj, key, { get: function () { if (Dep.target) { dep.addDep(Dep.target); } return val; }, set: function (newVal) { if (newVal === val) return; val = newVal; dep.notify(); } }); } //# sourceMappingURL=Observe.js.map var DiliComponent = function (component) { function DiliElement() { var construct = Reflect.construct(HTMLElement, [], DiliElement); construct.constructor(component); return construct; } DiliElement.prototype = Object.create(HTMLElement.prototype, { constructor: { value: function constructor() { this.component = component; if (typeof this.component.ready === 'function') { this.component.ready(); } return DiliElement; } }, createBinding: { value: function createBinding(childNodes) { var _this = this; childNodes.forEach(function (node) { var reg = /{{(.*)}}/; var that = _this; var nodeName = node.nodeName.toLowerCase(); if (nodeName === 'input') { if (node.attributes && node.attributes.length > 0) { var mapName = void 0; var _loop_1 = function (i) { var attr = node.attributes[i]; if (attr.name === '[model]') { var name_1 = (mapName = attr.nodeValue); node.addEventListener('input', function (e) { that.component[name_1] = e.target.value; }); node.value = that.component.data[name_1]; node.removeAttribute('[model]'); } }; for (var i = 0; i < node.attributes.length; i++) { _loop_1(i); } var watcher = new Watcher(that.component, node, mapName, 'input'); } } if (node.nodeType === node.TEXT_NODE) { if (reg.test(node.nodeValue)) { var name_2 = RegExp.$1; name_2 = name_2.trim(); var watcher = new Watcher(that.component, node, name_2, 'text'); } } if (nodeName === 'p') { if (reg.test(node.innerHTML)) { var name_3 = RegExp.$1; name_3 = name_3.trim(); var watcher = new Watcher(that.component, node, name_3, 'p'); } } }); } }, bindData: { value: function () { var data = this.component.data; if (data) { Observe(data, this.component); } var thatDoc = document; var thisDoc = (thatDoc._currentScript || thatDoc.currentScript).ownerDocument; var querySelector = thisDoc.querySelector('template'); if (querySelector) { this.createBinding(querySelector.content.childNodes); this.appendChild(querySelector.content); } } }, getAttrData: { value: function getAttrData() { var attrToRemove = []; if (this.attributes && this.attributes.length > 0) { for (var i = 0; i < this.attributes.length; i++) { var attribute = this.attributes[i]; if (/\[(\w+)\]/.test(attribute.name)) { var name_4 = RegExp.$1; console.log(name_4); if (name_4 === 'draggable') { this.setAttribute(name_4, true); } else { this.component.data[name_4] = attribute.value; } attrToRemove.push(attribute.name); } } for (var _i = 0, attrToRemove_1 = attrToRemove; _i < attrToRemove_1.length; _i++) { var remove = attrToRemove_1[_i]; this.removeAttribute(remove); } } } }, getBindEvents: { value: function getAttrData() { var eventMap = []; if (this.attributes && this.attributes.length > 0) { for (var i = 0; i < this.attributes.length; i++) { var attribute = this.attributes[i]; if (/\((\w+)\)/.test(attribute.name)) { var name_5 = RegExp.$1; eventMap.push({ event: name_5, method: attribute.value.replace(/\(\)/, '') }); } } } return eventMap; } }, connectedCallback: { value: function connectedCallback() { var eventMap = this.getBindEvents(); this.addEvents(this, eventMap); this.getAttrData(); this.bindData(); this.component.connected && this.component.connected(); } }, attributeChangedCallback: { value: function attributeChangedCallback() { console.log('attributeChangedCallback'); this.component.change && this.component.change(); } }, disconnectedCallback: { value: function disconnectedCallback() { console.log('disconnectedCallback'); this.component.disconnected && this.component.disconnected(); } }, adoptedCallback: { value: function adoptedCallback() { console.log('adoptedCallback'); this.component.adopted && this.component.adopted(); } }, addEvents: { value: function (node, eventMap) { for (var i = 0; i < eventMap.length; i++) { var event_1 = eventMap[i]; this.addEvent(node, event_1); } } }, addEvent: { value: function (node, event) { node.addEventListener(event.event, this.component.methods[event.method]); } }, fireEvent: { value: function () { return; } }, removeEvent: { value: function () { return; } }, removeEvents: { value: function () { return; } } }); return customElements.define("" + component.is, DiliElement); }; var components = []; function Component(component) { var diliComponent = DiliComponent(component); components.push({ is: component.is, component: diliComponent }); App.components = components; } //# sourceMappingURL=oan.js.map exports.App = App; exports.Component = Component; exports.DiliComponent = DiliComponent; Object.defineProperty(exports, '__esModule', { value: true }); })));
import React, { Component } from 'react'; import { saveTraining } from '../ServerCalls.js'; import './Training.css'; export class TrainingForm extends Component { constructor(props) { super(props) this.state = { date: '', duration: 0, activity: '' } } /** |-------------------------------------------------- | Set state by given input data |-------------------------------------------------- */ handleChange = (event) => { this.setState({ [event.target.name]: event.target.value }) } /** |-------------------------------------------------- | On submit creates new training object with | customer id link as foreign key and save to the | database |-------------------------------------------------- */ handleSubmit = (event) => { event.preventDefault() const newTraining = { date: this.state.date, duration: this.state.duration, activity: this.state.activity, customer: this.props.customerData } saveTraining(newTraining) .then(response => { this.props.setModal() }) .catch(err => { console.log(err) }) } render() { return ( <div> <form onSubmit={this.handleSubmit}> <div className="form-group"> <label htmlFor="date">Date</label> <input type="date" className="form-control" id="date" name="date" value={this.state.date} onChange={this.handleChange} /> </div> <div className="form-group"> <label htmlFor="time">Duration in minutes</label> <input type="number" className="form-control" id="time" name="duration" value={this.state.duration} onChange={this.handleChange} /> </div> <div className="form-group "> <label htmlFor="activity">Training activity</label> <input type="text" className="form-control" id="activity" name="activity" value={this.state.activity} onChange={this.handleChange} /> </div> <input type="submit" className="btn create_training_button" value="Create new training activity" /> </form> </div> ) } } export default TrainingForm
'use strict'; const getDBConfig = require('./get-db-config.js'); /** * get config object for Knex DB connection, including connection params * @return {object} config object */ function getKnexConfig(opts) { const options = opts || {}; const dbConfig = getDBConfig(); return { debug: false, client: 'pg', connection: { host: dbConfig.host, port: dbConfig.port, user: dbConfig.username, password: dbConfig.password, database: dbConfig.db }, pool: { min: 1, max: 10 } }; } module.exports = getKnexConfig;