text
stringlengths
7
3.69M
import React, { useState, useEffect } from "react"; import { withRouter } from "react-router-dom"; import { post } from "axios"; import PropTypes from "prop-types"; import MuiAlert from "@material-ui/lab/Alert"; //--------------------------------- What was used from material ui core ------------------------------------- import { Table, TableBody, TableCell, Tooltip, TableContainer, Button, TableHead, TableRow, Paper, Grid, Typography, withStyles, Snackbar, Select, FormControl, useTheme, TablePagination, TableFooter, IconButton, InputBase, makeStyles, } from "@material-ui/core"; //----------------------------------------------------------------------------------------------------------- //------------------------------ Another Components Used In This Component ---------------------------------- import EditNumberOfGroupForStudent from "../AllstudentsInSubjectForms/EditNumberOfGroupForStudent"; //----------------------------------------------------------------------------------------------------------- //------------------------------------------------------- Icons --------------------------------------------- import FolderIcon from "@material-ui/icons/Folder"; import EditIcon from "@material-ui/icons/Edit"; import SearchIcon from "@material-ui/icons/Search"; import FirstPageIcon from "@material-ui/icons/FirstPage"; import KeyboardArrowLeft from "@material-ui/icons/KeyboardArrowLeft"; import KeyboardArrowRight from "@material-ui/icons/KeyboardArrowRight"; import LastPageIcon from "@material-ui/icons/LastPage"; // -------------------------------------- table pagination with it's style ---------------------------------- const useStyles1 = makeStyles((theme) => ({ root: { flexShrink: 0, marginLeft: theme.spacing(2.5), }, })); function TablePaginationActions(props) { const classes = useStyles1(); const theme = useTheme(); const { count, page, rowsPerPage, onChangePage } = props; const handleFirstPageButtonClick = (event) => { onChangePage(event, 0); }; const handleBackButtonClick = (event) => { onChangePage(event, page - 1); }; const handleNextButtonClick = (event) => { onChangePage(event, page + 1); }; const handleLastPageButtonClick = (event) => { onChangePage(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1)); }; return ( <div className={classes.root}> <Tooltip title="First Page" placement="bottom"> <IconButton onClick={handleFirstPageButtonClick} disabled={page === 0} aria-label="first page" > {theme.direction === "rtl" ? <LastPageIcon /> : <FirstPageIcon />} </IconButton> </Tooltip> <Tooltip title="Previous Page" placement="bottom"> <IconButton onClick={handleBackButtonClick} disabled={page === 0} aria-label="previous page" > {theme.direction === "rtl" ? ( <KeyboardArrowRight /> ) : ( <KeyboardArrowLeft /> )} </IconButton> </Tooltip> <Tooltip title="Next Page" placement="bottom"> <IconButton onClick={handleNextButtonClick} disabled={page >= Math.ceil(count / rowsPerPage) - 1} aria-label="next page" > {theme.direction === "rtl" ? ( <KeyboardArrowLeft /> ) : ( <KeyboardArrowRight /> )} </IconButton> </Tooltip> <Tooltip title="Last Page" placement="bottom"> <IconButton onClick={handleLastPageButtonClick} disabled={page >= Math.ceil(count / rowsPerPage) - 1} aria-label="last page" > {theme.direction === "rtl" ? <FirstPageIcon /> : <LastPageIcon />} </IconButton> </Tooltip> </div> ); } TablePaginationActions.propTypes = { count: PropTypes.number.isRequired, onChangePage: PropTypes.func.isRequired, page: PropTypes.number.isRequired, rowsPerPage: PropTypes.number.isRequired, }; //------------------------------------------------------------------------------------------------------------ //-------------------------------------- Message Function ------------------------------------------------- function Alert(props) { return <MuiAlert elevation={6} variant="filled" {...props} />; } //----------------------------------------------------------------------------------------------------------- const StudentsInSubject = ({ match, classes, setCrumbs, reloadStudents, setReloadStudents, }) => { // ---------------------------- variables with it's states that we use it in this Page ------------------- const [open, setOpen] = React.useState(false); const [allStudents, setAllStudents] = useState(); const [displayedStudents, setDisplayedStudents] = useState(); const [ EditIsOpenChangeStudentGroup, setEditIsOpenChangeStudentGroup, ] = useState(false); const [currentEditedStudentGroup, setCurrentEditedStudentGroup] = useState(); const [query, setQuery] = useState(""); const [coulmnToQuery, setCoulmnToQuery] = useState("studentNameAR"); const [page, setPage] = React.useState(0); const [rowsPerPage, setRowsPerPage] = React.useState(5); const emptyRows = rowsPerPage - Math.min(rowsPerPage, displayedStudents?.length - page * rowsPerPage); //-------------------------------------------------------------------------------------------------------- // ---------------------- we use it To Show The Message after every operation -------------------------- const handleClick = () => { setOpen(true); }; // ------------------------------------------------------------------------------------------------------- // --------------- we use it To hide The Message that will appear after every operation ----------------- const handleClose = (event, reason) => { if (reason === "clickaway") { return; } setOpen(false); }; // ------------------------------------------------------------------------------------------------------- // ------------------------------------- API Calls --------------------------------------------------------- const listStudents = async () => { const StudentsUrl = `/DoctorManagestudentsGroups/GetEnrolledStudentsForSubject`; /* post syntax ( url " StudentsUrl (The local host that Get Students That Enrolled In Subject that the Instructor Choose) ", body "no body cause this function use parametares", options "It takes (3) Parameters" [1] SubjectId ... [2] semesterId ... [3] currentYear ) */ const { data } = await post(StudentsUrl, null, { params: { subjectId: match.params.courseId, }, }); setAllStudents(data); }; //-------------------------------------------------------------------------------------------------------- const EditStudentGroup = async (Group, student, callback) => { const url = "/DoctorManagestudentsGroups/updateStudentGroup"; await post(url, null, { params: { StudentID: student.StudentID, SubjectID: match.params.courseId, NewNumber: Group, }, }); handleClick(); setReloadStudents(true); if (callback) callback(); }; //-------------------------------------------------------------------------------------------------------- const handleChangePage = (newPage) => { setPage(newPage); }; const handleChangeRowsPerPage = (event) => { setRowsPerPage(parseInt(event.target.value, 10)); setPage(0); }; //---------------------------------------------------------------------------------------------------------- useEffect(() => { if (reloadStudents === true) { listStudents(); setReloadStudents(false); window.location.reload(); } }, [reloadStudents]); useEffect(() => { listStudents(); }, [match.params.courseId]); useEffect(() => { if (allStudents) { setDisplayedStudents([...allStudents]); } }, [allStudents]); useEffect(() => { if (query) { setDisplayedStudents([ ...allStudents?.filter((x) => x[coulmnToQuery].toLowerCase()?.includes(query.toLowerCase()) ), ]); } }, [query, coulmnToQuery]); useEffect(() => { setCrumbs([ { label: match.params.coursename, onClick: () => { setCrumbs((prevState) => [...prevState.slice(0, 1)]); }, Icon: FolderIcon, }, { label: "Enrolled Students", onClick: () => { setCrumbs((prevState) => [...prevState.slice(0, 2)]); }, Icon: FolderIcon, }, ]); }, []); return ( <React.Fragment> <Snackbar open={open} onClose={handleClose} autoHideDuration={2000} className={classes.message} > <Alert onClose={handleClose} severity="success"> {`${currentEditedStudentGroup?.studentNameAR} group number has been changed`} </Alert> </Snackbar> <EditNumberOfGroupForStudent title="Edit Student Group" CurrentGroup={currentEditedStudentGroup?.GroupNo} isOpened={EditIsOpenChangeStudentGroup} onClose={() => setEditIsOpenChangeStudentGroup(false)} onSubmit={({ ChosenNumberOfGroup }) => EditStudentGroup(ChosenNumberOfGroup, currentEditedStudentGroup, () => setEditIsOpenChangeStudentGroup(false) ) } /> <Grid container className={classes.mainPage}> <TableContainer className={classes.tablePosition} component={Paper}> <Grid item style={{ backgroundColor: "#0c6170", padding: "20px" }}> <Grid item> <Paper component="form" className={classes.root}> <InputBase className={classes.input} placeholder="Search" value={query} onChange={(e) => { setQuery(e.target.value); }} /> <IconButton className={classes.iconButton} aria-label="search"> <SearchIcon /> </IconButton> </Paper> </Grid> <Grid item style={{ marginTop: "-50px", marginLeft: "450px" }}> <Tooltip title="Search Type" placement="bottom"> <FormControl className={classes.formControl}> <Select native labelId="demo-simple-select-label" id="demo-simple-select" value={coulmnToQuery} onChange={(event) => { setCoulmnToQuery(event.target.value); }} style={{ backgroundColor: "white" }} > <option value="studentNameAR">Name</option> <option value="studentSeatNo">Seat Number</option> <option value="studentEmail">E-mail</option> </Select> </FormControl> </Tooltip> </Grid> </Grid> <Table style={{ minWidth: 650, }} size="small" stickyHeader aria-label="sticky table" > <TableHead> {/* The Header Of the Table That contains [1] Name ... [2] ID ... [3] E-Mail ... [4] Group Number */} <TableRow> <TableCell className={classes.tableHeader} align="left"> Name </TableCell> <TableCell className={classes.tableHeader} align="center"> ID </TableCell> <TableCell className={classes.tableHeader} align="center"> E-Mail </TableCell> <TableCell className={classes.tableHeader} align="center"> Group Number </TableCell> <TableCell className={classes.tableHeader} align="right"> {} </TableCell> </TableRow> </TableHead> <TableBody> {(rowsPerPage > 0 ? displayedStudents?.slice( page * rowsPerPage, page * rowsPerPage + rowsPerPage ) : displayedStudents )?.map((Student, index) => ( <TableRow key={index} style={ index % 2 ? { background: "#FFFFFF" } : { background: "#FFFFFF" } } > {/* Student Name cell */} <TableCell align="left"> <Grid container spacing={1}> <Typography>{Student.studentNameAR}</Typography> </Grid> </TableCell> {/* Student ID cell */} <TableCell align="center">{Student.studentSeatNo}</TableCell> {/* Student Email cell */} <TableCell align="center">{Student.studentEmail}</TableCell> {/* Student Group cell */} <TableCell align="center">{Student.GroupNo}</TableCell> <TableCell align="right"> <Tooltip title="Edit Student Group" placement="bottom"> <Button size="small"> <EditIcon onClick={() => { setEditIsOpenChangeStudentGroup(true); setCurrentEditedStudentGroup(Student); }} /> </Button> </Tooltip> </TableCell> </TableRow> ))} {emptyRows > 0 && ( <TableRow style={{ height: 53 * emptyRows }}> <TableCell colSpan={6} /> </TableRow> )} </TableBody> <TableFooter> <TableRow> <TablePagination rowsPerPageOptions={[5, 10, 25, { label: "All", value: -1 }]} colSpan={3} count={displayedStudents?.length} rowsPerPage={rowsPerPage} page={page} SelectProps={{ inputProps: { "aria-label": "rows per page" }, native: true, }} onChangePage={handleChangePage} onChangeRowsPerPage={handleChangeRowsPerPage} ActionsComponent={TablePaginationActions} backIconButtonProps={{ "aria-label": "Previous Page", }} nextIconButtonProps={{ "aria-label": "Next Page", }} /> </TableRow> </TableFooter> </Table> </TableContainer> </Grid> </React.Fragment> ); }; const styles = (theme) => ({ tableHeader: { backgroundColor: "#0c6170", fontSize: "17px", color: "white", fontweight: "bold", fontFamily: '"Lucida Sans Unicode","Helvetica","Arial"', }, tablePosition: { maxHeight: "85vh", overflowY: "auto", maxWidth: "165vh", marginLeft: "28px", marginTop: "20px", }, mainPage: { flexWrap: "nowrap", }, formControl: { margin: theme.spacing(1), minWidth: 140, }, textFieldRoot: { backgroundColor: "white", borderRadius: "7px", }, notchedOutline: { borderWidth: "1px", borderColor: `black !important`, }, label: { color: "black !important", fontWeight: "600", }, root: { padding: "2px 4px", display: "flex", alignItems: "center", width: 400, }, input: { marginLeft: theme.spacing(1), flex: 1, }, iconButton: { padding: 10, }, }); export default withStyles(styles)(withRouter(StudentsInSubject));
import React from 'react'; import Header from "./Header/Header"; import Refresh from "./Refresh/Refresh" const Sidebar = (props) => { return ( <div className="side"> <Header handleChange={props.handleChange} handleSearch={props.handleSearch} newTodo={props.newTodo} editing = {props.editing} updateTodo = {props.updateTodo} addTodo = {props.addTodo} searchEntry={props.searchEntry} /> <Refresh checkallPages={props.checkallPages} /> </div> ); } export default Sidebar;
var fs = require('fs'); var data = JSON.parse(fs.readFile('users.json') ); console.log(data); function addId () { for (var i=0; i<data.length; i++) var temp = data[i] console.log(i); };
var actions = require('../actions/index'); var initialLocationState = {name: ''}; var locationReducer = function(state, action) { state = state || initialLocationState; if (action.type === actions.FIND_LOCATIONS) { return { name: action.location }; } else if (action.type === actions.SELECT_LOCATION) { // Find the index of the matching location var index = -1; for (var i=0; i<state.length; i++) { var location = state[i]; if (location.name === action.location) { index = i; break; } } if (index === -1) { throw new Error('Could not find location'); } var before = state.slice(0, i); var after = state.slice(i + 1); var newLocation = Object.assign({}, location, {rating: action.rating}); return before.concat(newLocation, after); } return state; }; exports.locationReducer = locationReducer;
import React, { Component } from 'react' import { Link} from "react-router-dom"; import {createUser,createRealUser,UniqueName} from '../store/actions/authActions' import {connect} from 'react-redux'; import {Redirect} from 'react-router-dom' import * as firebase from 'firebase/app'; import 'firebase/auth'; class signup extends Component { state = { userName :'', Email:'', password:'', avatar:'', } UNSAFE_componentWillMount(){ firebase.auth().onAuthStateChanged((user) => { if (user) { // User is signed in. console.log(user); let emailVerified_me = firebase.auth().currentUser.emailVerified; this.setState({ emailVerified:emailVerified_me }) } }) } handleChange = (e) => { this.setState({ [e.target.id]:e.target.value }) } handleSubmit = e => { e.preventDefault(); this.props.createUser(this.state) } handleChange_file = e => { const input = this.refs.avatar; const reader = new FileReader(); reader.onload = () => { this.setState({ avatar:input.files[0] }) console.log(this.state) } reader.readAsDataURL(input.files[0]) console.log(input.files[0]) } handleKeyUp = () => { let userValue = this.refs.userNameUnique.value; if(userValue !== ''){ this.props.UniqueName(userValue) } } saveNcontinue = (e) => { e.preventDefault(); let {email,uid} = this.props.auth; let {userNAmeME,photoURL} =this.props.userDaTa let id = this.props.name; let data = { displayName:userNAmeME, email:email, photoURL:photoURL, uid:uid, abigoID:id } console.log(data) this.props.createRealUser(data) } render() { if(this.props.realUser) { console.log("Redirecting...") return <Redirect to="/" /> } if(this.props.created){ let clickMe=document.getElementById('stepReal'); console.log(clickMe); clickMe.click() } return ( <div className="background_linear_gradient_signup"> <div className="login_design_form"> <h6 className="center bold">ABIGOCHATS</h6> {this.props.created ? ( <p className="green-text center">User created successfully!!</p> ): ''} <div className="row"> <ul className="tabs spaced"> <li className="tab col s6 l6"> <Link to="#step1" className="active indigo-text text-darken-4">Step 1</Link> </li> <li className="tab col s6 l6"> <Link to="#step2" className="indigo-text text-darken-4" id="stepReal">Step 2</Link> </li> </ul> <div className="col s12" id="step1"> <div className="row"> <form className="col s12" onSubmit={this.handleSubmit}> <div className="row"> <div className="input-field col s6"> <input id="userName" type="text" className="validate" onChange={this.handleChange} /> <label htmlFor="userName">User Name</label> </div> <div className="input-field col s6"> <input id="Email" type="email" className="validate" onChange={this.handleChange}/> <label htmlFor="Email">Your Email</label> </div> <div className="input-field col s6"> <input id="password" type="password" className="validate" onChange={this.handleChange} autoComplete="new-password"/> <label htmlFor="password">Choose a password</label> </div> <div className="input-field col s6"> <input id="confirm_password" type="password" className="validate" autoComplete="new-password"/> <label htmlFor="confirm_password">Confirm password</label> </div> </div> <div className="file-field input-field"> <div className="waves-effect waves-light btn blue"> <span>Choose avatar</span> <input type="file" ref="avatar" id="avatar" onChange={this.handleChange_file}/> </div> <div className="file-path-wrapper"> <input className="file-path validate" type="text"/> </div> </div> <div className="input-field center"> <button type="submit" className="btn waves-effect waves-light custom_color">Create</button> </div> </form> </div> <div className="center" >Already Have an account? <Link to="/login">Login</Link></div> </div> <div className="col s12" id="step2"> <div className="row"> { this.state.emailVerified ? '' : ( <div> <p className="center flow-text">Email Verification</p> <p>1. You are one step ahead, Please verify your email.<br></br> verified : false (<b>if verified ignore it</b>)<br></br> <button className="btn btn-small" >Resend Email</button> </p> </div> )} <p>2. Choose user ID ( use: abc..,123..):</p> <form className="col s12" onSubmit={this.saveNcontinue}> <div className="input-field "> <input id="icon_prefix" type="text" className="validate" ref="userNameUnique" onKeyUp={this.handleKeyUp}/> <label htmlFor="icon_prefix">Choose unique userName</label> </div> { this.props.name.type ? ( <p className="green-text">@{this.props.name.name} is avaliable</p> ) : '' } { this.props.name.type === false ? ( <p className="red-text">@{this.props.name.name} is unavaliable</p> ):' ' } { this.props.name.type ? ( <div className="input-field center"> <button type="submit" className="btn waves-effect waves-light custom_color ">Save &amp; Continue</button> </div> ): ( <div className="input-field center"> <button type="submit" className="btn waves-effect waves-light custom_color disabled">Save &amp; Continue</button> </div> )} </form> </div> </div> </div> </div> </div> ) } } const mapToDispatch = (dispatch) => { return{ createUser:(cred) => dispatch(createUser(cred)), UniqueName:(name) => dispatch(UniqueName(name)), createRealUser:(data) => dispatch(createRealUser(data)) } } const mapStateToProps = (state) => { console.log(state) return{ auth:state.firebase.auth, name:state.auth.avaliable, created:state.auth.created, realUser:state.auth.realUser, userDaTa: state.auth.userDataaprofile } } export default connect(mapStateToProps,mapToDispatch)(signup)
const btnForm = document.getElementById("btn-form"); const username = document.getElementById("username"); const password = document.getElementById("password"); const form = document.getElementById("form"); // 登入 const ClickBtnForm = (e)=>{ e.preventDefault(); //信箱驗證 const myreg = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; const adminInfo = { username:username.value, password:password.value } if(username.value!=""&&myreg.test(username.value)&&password.value!=""){ axios.post(`${api_url}/admin/signin`,adminInfo) .then( res=>{ // console.log(res); if(res.data.success){ alert(`${res.data.message}!!`); const expired =res.data.expired; const token=res.data.token; // 存到cookies document.cookie = `hexToken=${token}; expires=${new Date(expired)};username=${username.value}`; document.cookie = `username=${(username.value).split("@")[0]}; expires=${new Date(expired)};`; window.location="product.html"; }else{ alert(`${res.data.message}!!請檢查帳號密碼!`); password.value= ""; } } ).catch(err=>{ console.dir(err) }) } }; // 監聽事件 // 表單按鈕點擊 btnForm.addEventListener("click",ClickBtnForm,false);
import React, { Component } from 'react'; import { connect } from 'react-redux'; import { Button, Card, CardBody, Col, Container, Form, Input, InputGroup, InputGroupAddon, InputGroupText, Row, FormFeedback } from 'reactstrap'; import { userActions } from '../../../actions'; import { utils } from '../../../utils'; import logo from '../../../assets/img/brand/newlogo-up.png' const LogoStyles = { textAlign: 'center', marginBottom: '16px' } class Register extends Component { constructor(props) { super(props); this.state = { user: { firstName: '', lastName: '', email: '', username: '', password: '' }, submitted: false, passwordCheck: '', passwordValid: true }; this.handlePasswordChange = this.handlePasswordChange.bind(this); this.handleChange = this.handleChange.bind(this); this.handleSubmit = this.handleSubmit.bind(this); } handleChange(event) { const { name, value } = event.target; const { user, passwordCheck } = this.state; this.setState({ user: { ...user, [name]: value, }, passwordValid: user.password === passwordCheck }); } handlePasswordChange(event) { const { name, value } = event.target; const { user } = this.state; this.setState({ [name]: value, passwordValid: user.password === value, }); } handleSubmit(event) { event.preventDefault(); this.setState({ submitted: true }); const { user, passwordValid } = this.state; const { dispatch } = this.props; if (user.email && user.username && user.password && passwordValid) { dispatch(userActions.register(utils.tools.camelCameToUnderscore(user))); } } onCancel(event) { event.preventDefault(); utils.history.push('/login'); } render() { const { registering } = this.props; const {user, submitted, passwordCheck, passwordValid} = this.state; return ( <div className="app flex-row align-items-center"> <Container> <Row className="justify-content-center"> <Col style={LogoStyles} md="8"> <img src={logo} height={100} alt="Logo"/> </Col> </Row> <Row className="justify-content-center"> <Col md="9" lg="7" xl="6"> <Card className="mx-4"> <CardBody className="p-4"> <Form> <h1>Register</h1> <p className="text-muted">Create your account</p> <InputGroup className="mb-3"> <InputGroupAddon addonType="prepend"> <InputGroupText> <i className="icon-user"></i> </InputGroupText> </InputGroupAddon> <Input type="text" placeholder="Username" autoComplete="username" name="username" value={user.username} invalid={submitted && !user.username} onChange={this.handleChange}/> { submitted && !user.username && <FormFeedback>Username is required...</FormFeedback> } </InputGroup> <InputGroup className="mb-3"> <InputGroupAddon addonType="prepend"> <InputGroupText>@</InputGroupText> </InputGroupAddon> <Input type="text" placeholder="Email" autoComplete="email" name="email" value={user.email} invalid={submitted && !user.email} onChange={this.handleChange}/> { submitted && !user.email && <FormFeedback>Email is required...</FormFeedback> } </InputGroup> <InputGroup className="mb-3"> <InputGroupAddon addonType="prepend"> <InputGroupText> <i className="icon-lock"></i> </InputGroupText> </InputGroupAddon> <Input type="password" placeholder="Password" autoComplete="new-password" name="password" value={user.password} invalid={submitted && !user.password} onChange={this.handleChange}/> { submitted && !user.password && <FormFeedback>Password is required...</FormFeedback> } </InputGroup> <InputGroup className="mb-3"> <InputGroupAddon addonType="prepend"> <InputGroupText> <i className="icon-lock"></i> </InputGroupText> </InputGroupAddon> <Input type="password" placeholder="Repeat password" autoComplete="new-password" name="passwordCheck" value={passwordCheck} invalid={!!passwordCheck && !passwordValid} valid={!!passwordCheck && passwordValid} onChange={this.handlePasswordChange}/> </InputGroup> <InputGroup className="mb-0"> <InputGroupAddon addonType="prepend"> <InputGroupText> <i className="icon-user"></i> </InputGroupText> </InputGroupAddon> <Input type="text" placeholder="First Name" autoComplete="first-name" name="firstName" value={user.firstName} onChange={this.handleChange}/> </InputGroup> <p className="help-block mb-2" style={{ fontSize: '80%' }}>* Optional</p> <InputGroup className="mb-0"> <InputGroupAddon addonType="prepend"> <InputGroupText> <i className="icon-user"></i> </InputGroupText> </InputGroupAddon> <Input type="text" placeholder="Last Name" autoComplete="last-name" name="lastName" value={user.lastName} onChange={this.handleChange}/> </InputGroup> <p className="help-block mb-4" style={{ fontSize: '80%' }}>* Optional</p> <Button color="primary" onClick={this.handleSubmit} block>Create Account</Button> <Button color="secondary" onClick={this.onCancel} block>Log In</Button> { registering && utils.loaders.StandardLoader() } </Form> </CardBody> {/*<CardFooter className="p-4"> <Row> <Col xs="12" sm="6"> <Button className="btn-facebook mb-1" block><span>facebook</span></Button> </Col> <Col xs="12" sm="6"> <Button className="btn-twitter mb-1" block><span>twitter</span></Button> </Col> </Row> </CardFooter>*/} </Card> </Col> </Row> </Container> </div> ); } } function mapStateToProps(state) { const { registering } = state.registration; return { registering }; } export default connect( mapStateToProps, null )(Register);
import commonjs from '@rollup/plugin-commonjs'; import resolve from '@rollup/plugin-node-resolve'; import typescript from 'rollup-plugin-typescript2'; import pkg from './package.json'; import image from '@rollup/plugin-image'; import { terser } from 'rollup-plugin-terser'; import { babel } from '@rollup/plugin-babel'; import peerDepsExternal from 'rollup-plugin-peer-deps-external'; import postcss from 'rollup-plugin-postcss'; const extensions = ['.js', '.jsx', '.ts', '.tsx']; export default { input: 'src/index.ts', output: [ { file: pkg.module, format: 'es', }, ], plugins: [ peerDepsExternal(), resolve({ extensions }), commonjs(), typescript({ useTsconfigDeclarationDir: true, }), image(), postcss({ modules: true, }), babel({ extensions, include: ['src/**/*'], babelHelpers: 'runtime' }), terser({ keep_classnames: true, keep_fnames: true, }), // minify ], };
var cli = require("./index"); var del = require('rimraf').sync; var assert = require('assert'); var exists = require('fs').existsSync; var prom = require('prom-seq'); del('test/fixtures/dist'); var task = prom.create(cli.tasks); task('', require('crossbow-ctx')()).then(function () { assert(exists('test/fixtures/dist/app.js')); assert(exists('test/fixtures/dist/app.js.map')); console.log('Build complete'); }).done();
// Require the testing dependencies const chai = require('chai'); const assert = chai.assert; // Require query function for getAllStudents check const query = require('../../lib/utils').query; // Require seed to reset database before each test const seed = require('../../lib/seed').dbSeed; // The file to be tested const students = require('../../routes/students'); // Get contents of Students table in DB for use in asserts function getAllStudents() { return query('SELECT * FROM Student'); } // Save memory of old database var oldDB; var studentCount; var oldPrograms; var programMatchCount; // Create example students for expected results var percy = { 'student_id': 1, 'first_name': 'Percy', 'last_name': 'Jackson', 'dob': new Date(93, 7, 18) }; var perseus = { 'student_id': 1, 'first_name': 'Perseus', 'last_name': 'Jackson', 'dob': new Date(93, 7, 18) }; var percyNewDob = { 'student_id': 1, 'first_name': 'Percy', 'last_name': 'Jackson', 'dob': new Date(90, 2, 15) }; var annabethURL = { 'first_name': 'Annabeth', 'last_name': 'Chase', 'dob': '1993-07-12' }; var annabeth = { 'student_id': 2, 'first_name': 'Annabeth', 'last_name': 'Chase', 'dob': new Date(93, 6, 12) }; var magnus = { 'student_id': 2, 'first_name': 'Magnus', 'last_name': 'Chase', 'dob': new Date(93, 6, 12) }; var brian = { 'student_id': 3, 'first_name': 'Brian', 'last_name': 'Smith', 'dob': new Date(93, 3, 12) }; var daveURL = { 'first_name': 'Dave', 'last_name': 'Strider', 'dob': '1995-12-03' }; var dave = { 'student_id': 5, 'first_name': 'Dave', 'last_name': 'Strider', 'dob': new Date(95, 11, 3) }; var pam = { 'student_id': 4, 'first_name': 'Pam', 'last_name': 'Ho', 'dob': new Date(93, 3, 12) }; var poseidonsson = { 'student_id': 1, 'first_name': 'Percy', 'last_name': 'Poseidonsson', 'dob': new Date(93, 7, 18) }; var hazel = { 'student_id': 1, 'first_name': 'Hazel', 'last_name': 'Levesque', 'dob': new Date(28, 11, 17) }; // Students testing block describe('Students', function() { // ADD BEFORE EACH TO reseed beforeEach(function(done) { seed().then(function() { done(); }); }); // Get the original state of the database before(function(done) { seed().then(function() { getAllStudents().then(function(data) { // Remember the Student table oldDB = data; studentCount = data.length; return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { // Remember the StudentToProgram table oldPrograms = data; programMatchCount = data.length; done(); }); }); }); describe('getStudents(req)', function() { it('should get all the students in the database', function(done) { var promise = students.getStudents({ // Express has empty query, params, and body by default in req query: {}, params: {}, body: {} }); // When the promised data is returned, check it against the expected data promise.then(function(data) { assert.deepEqual([percy, annabeth, brian, pam], data); done(); }); }); it('should be able to get a student using first, last name and birthday', function(done) { var req = { query: { first_name: 'Percy', last_name: 'Jackson', dob: '1993-08-18' } }; var promise = students.getStudents(req); promise.then(function(data) { // Check that we received the correct student assert.deepEqual(data, [percy]); done(); }); }); it('should give an error if birthdate is not parseable to a date object', function(done) { var req = { query: { first_name: 'Percy', last_name: 'Jackson', dob: '1992-34-54' } }; var promise = students.getStudents(req); promise.catch(function(err) { assert.equal(err.message, 'Failed to get student due to invalid birthdate. Try yyyy-mm-dd.'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'dob'); assert.equal(err.propertyValue, req.query.dob); assert.equal(err.status, 400); done(); }); }); it('should give an error if birthdate is in an unexpected date format ' + '(e.g. MM-DD-YYYY instead of YYYY-MM-DD)', function(done) { var req = { query: { first_name: 'Percy', last_name: 'Jackson', dob: '08-18-1993' } }; var promise = students.getStudents(req); promise.catch(function(err) { assert.equal(err.message, 'Failed to get student due to invalid birthdate. Try yyyy-mm-dd.'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'dob'); assert.equal(err.propertyValue, req.query.dob); assert.equal(err.status, 400); done(); }); }); it('should give an error if the request is not an option listed in ' + 'the API documentation (unexpected format)', function(done) { var req = { query: { first_name: 'Annabeth' } }; var promise = students.getStudents(req); promise.catch(function(err) { assert.equal(err.message, 'The API does not support a request of this format. ' + ' See the documentation for a list of options.'); assert.equal(err.name, 'UnsupportedRequest'); assert.equal(err.status, 501); done(); }); }); }); describe('getStudentsByProgram(req)', function() { it('should get all the students for a given program', function(done) { var req = { params: { program_id: 1 } }; var promise = students.getStudentsByProgram(req); promise.then(function(data) { // Check that we received the correct students assert.deepEqual([percy, annabeth, pam], data); done(); }); }); it('should give an error if the program_id is negative', function(done) { var req = { params: { program_id: -4 } }; var promise = students.getStudentsByProgram(req); promise.catch(function(err) { assert.equal(err.message, 'Given program_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'program_id'); assert.equal(err.propertyValue, req.params.program_id); assert.equal(err.status, 400); done(); }); }); it('should give an error if the program_id is not an integer', function(done) { var req = { params: { program_id: 'SuperbadInput' } }; var req2 = { params: { program_id: 1.22 } }; var promise = students.getStudentsByProgram(req); promise.catch(function(err) { assert.equal(err.message, 'Given program_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'program_id'); assert.equal(err.propertyValue, req.params.program_id); assert.equal(err.status, 400); }); promise = students.getStudentsByProgram(req2); promise.catch(function(err) { assert.equal(err.message, 'Given program_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'program_id'); assert.equal(err.propertyValue, req2.params.program_id); assert.equal(err.status, 400); done(); }); }); it('should give an error if the program_id is not in the database', function(done) { var req = { params: { program_id: 4231 } }; var promise = students.getStudentsByProgram(req); promise.catch(function(err) { assert.equal(err.message, 'Invalid request: The given program_id does not exist in the' + ' database'); assert.equal(err.name, 'ArgumentNotFoundError'); assert.equal(err.propertyName, 'program_id'); assert.equal(err.propertyValue, req.params.program_id); assert.equal(err.status, 404); done(); }); }); }); describe('getStudentsByEvent(req)', function() { it('should get all the students associated with a given event', function(done) { var req = { params: { event_id: 4 } }; var promise = students.getStudentsByEvent(req); promise.then(function(data) { // Check that we received the correct students assert.deepEqual([annabeth], data); done(); }); }); it('should give an error if the event_id is negative', function(done) { var req = { params: { event_id: -4 } }; var promise = students.getStudentsByEvent(req); promise.catch(function(err) { assert.equal(err.message, 'Given event_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'event_id'); assert.equal(err.propertyValue, req.params.event_id); assert.equal(err.status, 400); done(); }); }); it('should give an error if the event_id is not an integer', function(done) { var req = { params: { event_id: 'SuperbadInput' } }; var req2 = { params: { event_id: 5.6 } }; var promise = students.getStudentsByEvent(req); promise.catch(function(err) { assert.equal(err.message, 'Given event_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'event_id'); assert.equal(err.propertyValue, req.params.event_id); assert.equal(err.status, 400); }); promise = students.getStudentsByEvent(req2); promise.catch(function(err) { assert.equal(err.message, 'Given event_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'event_id'); assert.equal(err.propertyValue, req2.params.event_id); assert.equal(err.status, 400); done(); }); }); it('should give an error if the event_id is not in the database', function(done) { var req = { params: { event_id: 423 } }; var promise = students.getStudentsByEvent(req); promise.catch(function(err) { assert.equal(err.message, 'Invalid request: The given event_id does not exist in the' + ' database'); assert.equal(err.name, 'ArgumentNotFoundError'); assert.equal(err.propertyName, 'event_id'); assert.equal(err.propertyValue, req.params.event_id); assert.equal(err.status, 404); done(); }); }); }); describe('getStudentsBySite(req)', function() { it('should get all the students for a given site', function(done) { var req = { params: { site_id: 2 } }; students.getStudentsBySite(req) .then(function(data) { // Check that we received the correct students assert.deepEqual([brian], data); done(); }); }); it('should give an error if the site_id is negative', function(done) { var req = { params: { site_id: -4 } }; var promise = students.getStudentsBySite(req); promise.catch(function(err) { assert.equal(err.message, 'Given site_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'site_id'); assert.equal(err.propertyValue, req.params.site_id); assert.equal(err.status, 400); done(); }); }); it('should give an error if the site_id is not an integer', function(done) { var req = { params: { site_id: 'ADogNamedSpy' } }; var req2 = { params: { site_id: 3.1 } }; var promise = students.getStudentsBySite(req); promise.catch(function(err) { assert.equal(err.message, 'Given site_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'site_id'); assert.equal(err.propertyValue, req.params.site_id); assert.equal(err.status, 400); }); promise = students.getStudentsBySite(req2); promise.catch(function(err) { assert.equal(err.message, 'Given site_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'site_id'); assert.equal(err.propertyValue, req2.params.site_id); assert.equal(err.status, 400); done(); }); }); it('should give an error if the site_id is not in the database', function(done) { var req = { params: { site_id: 1234 } }; var promise = students.getStudentsBySite(req); promise.catch(function(err) { assert.equal(err.message, 'Invalid request: The given site_id does not exist in the' + ' database'); assert.equal(err.name, 'ArgumentNotFoundError'); assert.equal(err.propertyName, 'site_id'); assert.equal(err.propertyValue, req.params.site_id); assert.equal(err.status, 404); done(); }); }); }); describe('getStudent(req)', function() { it('should get an existing student by id', function(done) { var req = { params: { // The student_id is contained in the request student_id: 1 } }; var promise = students.getStudent(req); promise.then(function(data) { // Check that we received the correct student assert.deepEqual([percy], data); done(); }); }); it('should not get if request is missing params section', function(done) { var req = {}; students.getStudent(req) .catch(function(err) { assert.equal(err.message, 'Request must have a params section with a valid student_id'); assert.equal(err.name, 'MissingFieldError'); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); done(); }); }); it('should not get if request is missing a student_id', function(done) { var req = { params: { } }; students.getStudent(req) .catch(function(err) { assert.equal(err.message, 'Request must have a params section with a valid student_id'); assert.equal(err.name, 'MissingFieldError'); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); done(); }); }); it('should give an error if the student_id is negative', function(done) { var req = { params: { // The student_id is contained in the request student_id: -2 } }; var promise = students.getStudent(req); promise.catch(function(err) { assert.equal(err.message, 'Given student_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'student_id'); assert.equal(err.propertyValue, req.params.student_id); assert.equal(err.status, 400); done(); }); }); it('should give an error if the student_id is not an integer', function(done) { var req = { params: { // The student_id is contained in the request student_id: 'superbad' } }; var req2= { params: { // The student_id is contained in the request student_id: 867.5309 } }; var promise = students.getStudent(req); promise.catch(function(err) { assert.equal(err.message, 'Given student_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'student_id'); assert.equal(err.propertyValue, req.params.student_id); assert.equal(err.status, 400); }); promise = students.getStudent(req2); promise.catch(function(err) { assert.equal(err.message, 'Given student_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'student_id'); assert.equal(err.propertyValue, req2.params.student_id); assert.equal(err.status, 400); done(); }); }); it('should return an empty array if the student_id is not in the database', function(done) { var req = { params: { student_id: 5736 } }; students.getStudent(req) .then(function(data) { assert.deepEqual(data, []); assert.lengthOf(data, 0); done(); }); }); }); describe('createStudent(req)', function() { it('should add a new student to the database', function(done) { var req = { params: { program_id: 2 }, body: daveURL }; students.createStudent(req) .then(function(data) { // Check that the new student is returned assert.deepEqual(data, [dave]); // Get the contents of the database after calling createStudent return getAllStudents(); }) .then(function(data) { // Verify that the number of students in the DB increased by one assert.lengthOf(data, studentCount + 1); // Verify that the correct student data was added assert.deepEqual([percy, annabeth, brian, pam, dave], data); // Verify the old data wasn't received assert.notDeepEqual(oldDB, data); return query('SELECT program_id FROM StudentToProgram ' + 'WHERE student_id=5'); }) .then(function(data) { assert.deepEqual(data, [{ program_id: req.params.program_id }]); done(); }); }); it('should return an error and not post if the student already exists', function(done) { var req = { params: { program_id: 1 }, body: annabethURL }; students.createStudent(req) .catch(function(err) { assert.equal(err.message, 'Unable to create student: the student is already in ' + 'the database'); assert.equal(err.name, 'DatabaseConflictError'); assert.equal(err.status, 409); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); done(); }); }); it('should not post if request is missing a body', function(done) { var req = { params: { program_id: 1 } }; students.createStudent(req) .catch(function(err) { assert.equal(err.message, 'Request must have body and params sections. Within params, a ' + 'valid program_id must be given. Within body, a valid first_name, ' + 'last_name, and birthdate (dob) must be given.'); assert.equal(err.name, 'MissingFieldError'); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); done(); }); }); it('should not post if request is missing params section', function(done) { var req = { body: { first_name: 'Asami', last_name: 'Sato', dob: '1994-05-23' } }; students.createStudent(req) .catch(function(err) { assert.equal(err.message, 'Request must have body and params sections. Within params, a ' + 'valid program_id must be given. Within body, a valid first_name, ' + 'last_name, and birthdate (dob) must be given.'); assert.equal(err.name, 'MissingFieldError'); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); done(); }); }); it('should not post if request is missing a program_id', function(done) { var req = { params: { }, body: { first_name: 'Asami', last_name: 'Sato', dob: '1994-05-23' } }; students.createStudent(req) .catch(function(err) { assert.equal(err.message, 'Request must have body and params sections. Within params, a ' + 'valid program_id must be given. Within body, a valid first_name, ' + 'last_name, and birthdate (dob) must be given.'); assert.equal(err.name, 'MissingFieldError'); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); done(); }); }); it('should not post a student if request is missing a last name', function(done) { var req = { params: { program_id: 1 }, body: { first_name: 'Korra', dob: '1994-11-18' } }; students.createStudent(req) .catch(function(err) { assert.equal(err.message, 'Request must have body and params sections. Within params, a ' + 'valid program_id must be given. Within body, a valid first_name, ' + 'last_name, and birthdate (dob) must be given.'); assert.equal(err.name, 'MissingFieldError'); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); done(); }); }); it('should not post a student if request is missing a birthdate', function(done) { var req = { params: { program_id: 1 }, body: { first_name: 'Asami', last_name: 'Sato' } }; students.createStudent(req) .catch(function(err) { assert.equal(err.message, 'Request must have body and params sections. Within params, a ' + 'valid program_id must be given. Within body, a valid first_name, ' + 'last_name, and birthdate (dob) must be given.'); assert.equal(err.name, 'MissingFieldError'); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); done(); }); }); it('should not post a student if the request is missing a first name', function(done) { var req = { params: { program_id: 2 }, body: { last_name: 'Lupin', dob: '1965-02-13' } }; students.createStudent(req) .catch(function(err) { assert.equal(err.message, 'Request must have body and params sections. Within params, a ' + 'valid program_id must be given. Within body, a valid first_name, ' + 'last_name, and birthdate (dob) must be given.'); assert.equal(err.name, 'MissingFieldError'); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); done(); }); }); it('should not post if the program_id not a positive integer', function(done) { var req = { params: { program_id: -2 }, body: { first_name: 'Hermione', last_name: 'Granger', dob: '1979-09-19' } }; var req2 = { params: { program_id: 'badInput' }, body: { first_name: 'Hermione', last_name: 'Granger', dob: '1979-09-19' } }; var req3 = { params: { program_id: 1.5 }, body: { first_name: 'Hermione', last_name: 'Granger', dob: '1979-09-19' } }; students.createStudent(req) .catch(function(err) { assert.equal(err.message, 'Given program_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'program_id'); assert.equal(err.propertyValue, req.params.program_id); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); }); students.createStudent(req2) .catch(function(err) { assert.equal(err.message, 'Given program_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'program_id'); assert.equal(err.propertyValue, req2.params.program_id); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); }); students.createStudent(req3) .catch(function(err) { assert.equal(err.message, 'Given program_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'program_id'); assert.equal(err.propertyValue, req3.params.program_id); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); done(); }); }); it('should not post a student if the program_id is not in the database', function(done) { var req = { params: { program_id: 1234 }, body: { first_name: 'Hermione', last_name: 'Granger', dob: '1979-09-19' } }; students.createStudent(req) .catch(function(err) { assert.equal(err.message, 'Invalid request: The given program_id does not exist' + ' in the database'); assert.equal(err.name, 'ArgumentNotFoundError'); assert.equal(err.propertyName, 'program_id'); assert.equal(err.propertyValue, req.params.program_id); assert.equal(err.status, 404); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); done(); }); }); it('should not post if birthdate is not parseable to a date object', function(done) { var req = { params: { program_id: 1 }, body: { first_name: 'Hermione', last_name: 'Granger', dob: 'NotADate' } }; students.createStudent(req) .catch(function(err) { assert.equal(err.message, 'Failed due to invalid birthdate. Try yyyy-mm-dd.'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'dob'); assert.equal(err.propertyValue, req.body.dob); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); done(); }); }); it('should not post if birthdate is in an unexpected date format ' + '(e.g. MM-DD-YYYY instead of YYYY-MM-DD)', function(done) { var req = { params: { program_id: 1 }, body: { first_name: 'Hermione', last_name: 'Granger', dob: '10-05-1945' } }; students.createStudent(req) .catch(function(err) { assert.equal(err.message, 'Failed due to invalid birthdate. Try yyyy-mm-dd.'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'dob'); assert.equal(err.propertyValue, req.body.dob); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); done(); }); }); }); describe('updateStudent(req)', function() { it('should update the first_name for a given student', function(done) { var req = { params: { student_id: 1 }, body: { first_name: 'Perseus' } }; students.updateStudent(req) .then(function(data) { // Check that the updated student is returned assert.deepEqual(data, [perseus]); // Get the DB after the update return getAllStudents(); }) .then(function(data) { // Assert that the number of students is the same as before assert.lengthOf(data, studentCount); // Assert that the old data and new data aren't the same assert.notDeepEqual(oldDB, data); // Assert that the new data reflects the update changes assert.deepEqual([perseus, annabeth, brian, pam], data); done(); }); }); it('should update the last_name for a given student', function(done) { var req = { params: { student_id: 1 }, body: { last_name: 'Poseidonsson' } }; students.updateStudent(req) .then(function(data) { // Check that the updated student is returned assert.deepEqual(data, [poseidonsson]); // Get the DB after the update return getAllStudents(); }) .then(function(data) { // Assert that the number of students is the same as before assert.lengthOf(data, studentCount); // Assert that the old data and new data aren't the same assert.notDeepEqual(oldDB, data); // Assert that the new data reflects the update changes assert.deepEqual([poseidonsson, annabeth, brian, pam], data); done(); }); }); it('should update the birthdate for a given student', function(done) { var req = { params: { student_id: 1 }, body: { dob: '1990-03-15' } }; students.updateStudent(req) .then(function(data) { // Check that the updated student is returned assert.deepEqual(data, [percyNewDob]); // Get the DB after the update return getAllStudents(); }) .then(function(data) { // Assert that the number of students is the same as before assert.lengthOf(data, studentCount); // Assert that the old data and new data aren't the same assert.notDeepEqual(oldDB, data); // Assert that the new data reflects the update changes assert.deepEqual([percyNewDob, annabeth, brian, pam], data); done(); }); }); it('should update multiple fields for a given student', function(done) { var req = { params: { student_id: 1 }, body: { first_name: 'Hazel', last_name: 'Levesque', dob: '1928-12-17' } }; students.updateStudent(req) .then(function(data) { // Check that the updated student is returned assert.deepEqual(data, [hazel]); // Get the DB after the update return getAllStudents(); }) .then(function(data) { // Assert that the number of students is the same as before assert.lengthOf(data, studentCount); // Assert that the old data and new data aren't the same assert.notDeepEqual(oldDB, data); // Assert that the new data reflects the update changes assert.deepEqual([{ 'student_id': 1, 'first_name': 'Hazel', 'last_name': 'Levesque', 'dob': new Date(28, 11, 17) }, annabeth, brian, pam], data); done(); }); }); it('should not update if request is missing a body', function(done) { var req = { params: { student_id: 1 } }; students.updateStudent(req) .catch(function(err) { assert.equal(err.message, 'Request must have body and params sections. Within params, a ' + 'valid student_id must be given. Body should contain updated ' + 'values for fields to be updated.'); assert.equal(err.name, 'MissingFieldError'); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); assert.lengthOf(oldPrograms, programMatchCount); done(); }); }); it('should not update if request is missing params section', function(done) { var req = { body: { first_name: 'Stiles', last_name: 'Stilinski' } }; students.updateStudent(req) .catch(function(err) { assert.equal(err.message, 'Request must have body and params sections. Within params, a ' + 'valid student_id must be given. Body should contain updated ' + 'values for fields to be updated.'); assert.equal(err.name, 'MissingFieldError'); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); assert.lengthOf(oldPrograms, programMatchCount); done(); }); }); it('should not update if request is missing student_id', function(done) { var req = { params: { program_id: 2 }, body: { first_name: 'Stiles', last_name: 'Stilinski' } }; students.updateStudent(req) .catch(function(err) { assert.equal(err.message, 'Request must have body and params sections. Within params, a ' + 'valid student_id must be given. Body should contain updated ' + 'values for fields to be updated.'); assert.equal(err.name, 'MissingFieldError'); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); assert.lengthOf(oldPrograms, programMatchCount); done(); }); }); it('should return an error if birthdate is not in valid format', function(done) { var req = { params: { student_id: 1 }, body: { dob: '1994-33-22' } }; students.updateStudent(req) .catch(function(err) { assert.equal(err.message, 'Failed due to invalid birthdate. Try yyyy-mm-dd.'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'dob'); assert.equal(err.propertyValue, req.body.dob); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); assert.lengthOf(oldPrograms, programMatchCount); done(); }); }); it('should give an error if the student_id is not a positive integer', function(done) { var req = { params: { student_id: -2 }, body: { dob: '1994-33-22' } }; students.updateStudent(req) .catch(function(err) { assert.equal(err.message, 'Given student_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'student_id'); assert.equal(err.propertyValue, req.params.student_id); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); assert.lengthOf(oldPrograms, programMatchCount); done(); }); }); it('should give an error if the student_id is not in the database', function(done) { var req = { params: { student_id: 777 }, body: { first_name: 'Karkat' } }; students.updateStudent(req) .catch(function(err) { assert.equal(err.message, 'Invalid request: The given student_id does not exist' + ' in the database'); assert.equal(err.name, 'ArgumentNotFoundError'); assert.equal(err.propertyName, 'student_id'); assert.equal(err.propertyValue, req.params.student_id); assert.equal(err.status, 404); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); assert.lengthOf(oldPrograms, programMatchCount); done(); }); }); it('should update a student\'s program', function(done) { var req = { params: { student_id: 2, program_id: 3 }, body: { } }; students.updateStudent(req) .then(function(data) { // Check that the updated student is returned assert.deepEqual(data, [annabeth]); // Get the DB after the update return getAllStudents(); }) .then(function(data) { // Assert that the number of students is the same as before assert.lengthOf(data, studentCount); // Assert that the old data and new student data are the same assert.deepEqual(oldDB, data); // Check that program was updated return query('SELECT program_id FROM StudentToProgram ' + 'WHERE student_id=' + req.params.student_id); }) .then(function(data) { // Assert that the program_id is the same as the update request. assert.deepEqual(data, [{program_id: req.params.program_id}]); done(); }); }); it('should update a student\'s program and other fields', function(done) { var req = { params: { student_id: 2, program_id: 3 }, body: { first_name: 'Magnus' } }; students.updateStudent(req) .then(function(data) { // Check that the updated student is returned assert.deepEqual(data, [magnus]); // Get the DB after the update return getAllStudents(); }) .then(function(data) { // Assert that the number of students is the same as before assert.lengthOf(data, studentCount); // Assert that the old data and new data aren't the same assert.notDeepEqual(oldDB, data); // Assert that the new data reflects the update changes assert.deepEqual([percy, magnus, brian, pam], data); // Check that program was updated return query('SELECT program_id FROM StudentToProgram ' + 'WHERE student_id=' + req.params.student_id); }) .then(function(data) { // Assert that the program_id is the same as the update request. assert.deepEqual(data, [{program_id: req.params.program_id}]); done(); }); }); it('should give an error if the program_id is not a positive integer', function(done) { var req = { params: { student_id: 2, program_id: -1 }, body: { dob: '1994-07-22' } }; students.updateStudent(req) .catch(function(err) { assert.equal(err.message, 'Given program_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'program_id'); assert.equal(err.propertyValue, req.params.program_id); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); assert.lengthOf(oldPrograms, programMatchCount); done(); }); }); it('should give an error if the program_id is not in the database', function(done) { var req = { params: { student_id: 1, program_id: 323 }, body: { first_name: 'Karkat' } }; students.updateStudent(req) .catch(function(err) { assert.equal(err.message, 'Invalid request: The given program_id does not exist' + ' in the database'); assert.equal(err.name, 'ArgumentNotFoundError'); assert.equal(err.propertyName, 'program_id'); assert.equal(err.propertyValue, req.params.program_id); assert.equal(err.status, 404); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); assert.lengthOf(oldPrograms, programMatchCount); done(); }); }); }); describe('deleteStudent(req)', function() { it('should delete a given student from the database', function(done) { var req = { params: { student_id: 2 } }; students.deleteStudent(req) .then(function(data) { // Check that the updated student is returned assert.deepEqual(data, [annabeth]); // Get the current student data in the database return getAllStudents(); }) .then(function(data) { // Check that the number of students decreased by one assert.lengthOf(data, studentCount - 1); // Check that the data is not equal to the old DB state assert.notDeepEqual(oldDB, data); // Check that the correct student is no longer present assert.deepEqual([percy, brian, pam], data); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { // The rows for the student in StudentToProgram should be deleted assert.notDeepEqual(oldPrograms, data); assert.lengthOf(data, programMatchCount - 1); assert.deepEqual(data, [{ id: 1, student_id: 1, program_id: 1 }, { id: 3, student_id: 4, program_id: 1 }, { id: 4, student_id: 3, program_id: 2 }]); return query('SELECT * FROM Measurement'); }) .then(function(data) { // The matching rows in Measurement should also be deleted assert.deepEqual(data, [{ measurement_id: 1, student_id: 1, event_id: 1, height: 5, weight: 5, pacer: 5 }, { measurement_id: 2, student_id: 1, event_id: 2, height: 7, weight: 7, pacer: null }, { measurement_id: 6, student_id: 4, event_id: 2, height: 4, weight: 12, pacer: null }]); done(); }); }); it('should not get if request is missing params section', function(done) { var req = {}; students.deleteStudent(req) .catch(function(err) { assert.equal(err.message, 'Request must have a params section with a valid student_id'); assert.equal(err.name, 'MissingFieldError'); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); done(); }); }); it('should not get if request is missing a student_id', function(done) { var req = { params: { } }; students.deleteStudent(req) .catch(function(err) { assert.equal(err.message, 'Request must have a params section with a valid student_id'); assert.equal(err.name, 'MissingFieldError'); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); done(); }); }); it('should give an error if student_id is not a positive integer', function(done) { var req = { params: { student_id: 1.33 } }; students.deleteStudent(req) .catch(function(err) { assert.equal(err.message, 'Given student_id is of invalid format (e.g. not an integer or' + ' negative)'); assert.equal(err.name, 'InvalidArgumentError'); assert.equal(err.propertyName, 'student_id'); assert.equal(err.propertyValue, req.params.student_id); assert.equal(err.status, 400); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); assert.lengthOf(oldPrograms, programMatchCount); done(); }); }); it('should give an error if the student_id is not in the database', function(done) { var req = { params: { student_id: 617 } }; students.deleteStudent(req) .catch(function(err) { assert.equal(err.message, 'Invalid request: The given student_id does not exist' + ' in the database'); assert.equal(err.name, 'ArgumentNotFoundError'); assert.equal(err.propertyName, 'student_id'); assert.equal(err.propertyValue, req.params.student_id); assert.equal(err.status, 404); return getAllStudents(); }) .then(function(data) { // Check that nothing changed assert.deepEqual(oldDB, data); assert.lengthOf(data, studentCount); return query('SELECT * FROM StudentToProgram'); }) .then(function(data) { assert.deepEqual(oldPrograms, data); assert.lengthOf(oldPrograms, programMatchCount); done(); }); }); }); }); // TODO: Future-JIRA Factor out the "Is database unchanged?" check into // a separate method to avoid repeated code
var string = "Some string"; for (var i = 0; i < string.length; i++) { console.log(string.charCodeAt(i)); } //var string = "1928"; let num = 108; //let string = ''+num; let string = num.toString(); for (var i = 0; i < string.length; i++) { console.log(string.charCodeAt(i)); } console.log("abcd".charCodeAt(0));
/* reduceLISP.js - semantic transformation to simplify LISP tokens The MIT License (MIT) Copyright (c) 2016 Dale Schumacher Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ "use strict"; var semantic = module.exports; // var log = console.log; var log = function () {}; /* * transform(ns) - augment grammar namespace with reduction semantics */ semantic.transform = function transform(ns) { /* * Extract just the result value (no name) */ var transformValue = function transformValue(name, value) { log('transformValue:', name, value); var result = value; log('Value:', result); return result; }; /* * Collapse value to an object with just the rule name */ var transformNamed = function transformNamed(name, value) { log('transformNamed:', name, value); var result = { type: name }; log('Named:', result); return result; }; ns.transform('sexpr', function transformSexpr(name, value) { log('transformSexpr:', name, value); var result = value[1]; log('Sexpr:', result); return result; }); ns.transform('list', function transformList(name, value) { log('transformList:', name, value); var result = value[1]; log('List:', result); return result; }); ns.transform('atom', transformValue); ns.transform('number', function transformNumber(name, value) { log('transformNumber:', name, value); var result = parseInt(value.join(''), 10); log('Number:', result); return result; }); ns.transform('symbol', function transformSymbol(name, value) { log('transformSymbol:', name, value); var result = value.join(''); log('Symbol:', result); return result; }); ns.transform('_', transformNamed); return ns; };
import moment from 'moment' import 'moment/locale/es'; moment.updateLocale('es', { monthsShort : [ "ENE", "FEB", "MAR", "ABR", "MAY", "JUN", "JUL", "AGO", "SEP", "OCT", "NOV", "DIC" ] }) moment.locale('es') export const momentEs = moment
// DOM selection // document.getElementById() var p = document.getElementsByTagName('p'); for (let index = 0; index < p.length; index++) { p[index].style.backgroundColor = 'lightBlue'; } var nama = document.getElementById('judul'); const ismun = { name: "Bangkit Juang Raharjo" } nama.innerHTML = ismun.name; nama.style.color = "green";
//index.js var app = getApp() Page({ data: { bpm: 96, beat: 4, note: 4, bar: 0, beatArr: [], aliquots: 0, isPlay: null, count: 1, playQueue:[/*{ start: 0, bpm: 96, beat: 4, note: 4 }, { start: 10, bpm: 96, beat: 6, note: 8 }, { start: 14, bpm: 96, beat: 3, note: 4 }*/], curQueueIndex: 1 }, // 播放音频 audioPlay: function (key) { var objStop = {}; // 微信迷之设计 // 必须先停止 objStop[key] = { method: 'setCurrentTime', data: 0 } this.setData(objStop); // 再播放 var objStart = {}; objStart[key] = { method: 'play' } this.setData(objStart); }, // 指示条移动 moveBar: function() { var self = this; var curCount = self.data.count; var playQueue = self.data.playQueue; var queueLen = playQueue.length; var hasChange = false; // 有队列的情况 if (queueLen !== 0) { for (var i = 0; i < queueLen; i++) { if (playQueue[i].start === curCount && parseInt(self.data.bar) % 360 === 0) { hasChange = true; console.log(playQueue[i].start, self.data.bar) // 清除原来的计数器 self.pauseHandle(); self.setData({ bpm: playQueue[i].bpm, beat: playQueue[i].beat, note: playQueue[i].note, curQueueIndex: self.data.curQueueIndex + 1, // 因为清空了计数器,自己+1,否则死循环 count: curCount + 1 }) self.setBeatArr(); break; } } } // 如果队列出现了更替,重新开始 if (hasChange) { self.startHandle(); return; } // 非队列的默认逻辑 var bar = self.data.bar; bar += self.data.aliquots; var time = 60000 / self.data.bpm; var count = Math.ceil(bar / 360); self.setData({ bar: bar, count: count, time: time }) // 播放音频 // TODO: 精度问题 7/8拍,bar % 360 === 359.99999 // console.log(bar % 360) if (parseInt(bar) % 360 === 0) { self.audioPlay('strongAction'); } else { self.audioPlay('weekAction'); } }, // 开始 startHandle: function() { if (this.data.isPlay) { return; } var self = this; // 指示条位置移动 // 先立即移动 self.moveBar(); var time = 60000 / self.data.bpm; // 再间隔移动 var isPlay = setInterval(function() { self.moveBar(); }, time); self.setData({ isPlay: isPlay }) }, // 停止 stopHandle: function(e) { var self = this; clearTimeout(this.data.isPlay) this.setData({ isPlay: null, count: 1, bar: 0, curQueueIndex: 1 }) // 如果是队列状态,需要回到第一个队列 this.data.playQueue.length > 0 && this.onShow(); console.log(this.data.isPlay) }, // 暂定 pauseHandle: function(e) { clearTimeout(this.data.isPlay) this.setData({ isPlay: null }) }, onLoad: function () { console.log('onLoad index') }, // 生成圆圈旁边的刻度点 setBeatArr: function() { var self = this; // 计算beat分布 var beat = this.data.beat; var beatArr = []; var aliquots = 360 / beat; var len = beat; if(beat === 4 || beat === 8 || beat === 16) { // 某些节奏展示成16分更好 len = 16; } else if (beat === 3 || beat === 6 || beat === 9 || beat === 12) { // 展示成12分 len = 12; } for(var i = 0; i < len; i++) { beatArr.push((i + 1) * 360 / len) } this.setData({ beatArr: beatArr, aliquots: aliquots }) }, // tab开始展示的逻辑 onShow: function() { // 从存储取数据 var anm = wx.getStorageSync('anm') || 0; var noteStr = wx.getStorageSync('noteStr') || '4/4'; var noteArr = noteStr.split('/'); var playQueue = this.data.playQueue; if (playQueue.length === 0) { // 队列情况 this.setData({ bpm: wx.getStorageSync('bpm') || 96, beat: parseInt(noteArr[0]), note: parseInt(noteArr[1]) }) } else { // 默认情况 this.setData({ bpm: playQueue[0].bpm, beat: playQueue[0].beat, note: playQueue[0].note }) } this.setData({ anm: anm }) this.setBeatArr(); }, // 切换到其他tab时,停止 onHide: function() { this.stopHandle() }, // 下拉刷新 // TODO: 调查为毛没用 onPullDownRefresh: function(){ wx.stopPullDownRefresh() } })
// Definitions const DATAMEMBERS = 5; const random_uId = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; const random_name = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; function DataObj () { this['uId'] = ''; this['name'] = ''; } function randomData (type, base) { let valueLength = 0; let value = ''; let randomNumber; switch (type) { case 'id': valueLength = 10; for (let idIndex=0; idIndex<valueLength; idIndex++) { randomNumber = Math.floor(Math.random()*random_uId.length); value += random_uId.slice(randomNumber, randomNumber+1); } if (!checkUidUnique(value, base)) { value = randomData('id', base); } break; case 'name': valueLength = Math.ceil(Math.random()*10); for (let idIndex=0; idIndex<valueLength; idIndex++) { randomNumber = Math.floor(Math.random()*random_name.length); value += random_name.slice(randomNumber, randomNumber+1); } break; } return value; } function checkUidUnique (uId, base) { for (let baseIndex=0; baseIndex<base.length; baseIndex++) { if (base[baseIndex].uId == uId) { // if duplicate uId, random again return false; } } return true; } const ReducerRight = (state = [], action) => { let newState = state.slice(0); let dataTemp; switch (action['type']) { case 'RIGHT_LIST_INIT': newState = []; for (let i=0; i<DATAMEMBERS; i++) { dataTemp = new DataObj(); dataTemp['uId'] = randomData('id', newState); dataTemp['name'] = randomData('name'); newState.push(dataTemp); } return newState; case 'RIGHT_LIST_GET': return newState; case 'RIGHT_LIST_ADD': dataTemp = new DataObj(); dataTemp['uId'] = (('' != action['data'].uId) && (checkUidUnique(action['data'].uId, newState)))? action['data'].uId : randomData('id', newState); dataTemp['name'] = action['data'].name; newState.push(dataTemp); return newState; case 'RIGHT_LIST_REMOVE': for (let i=0; i<newState.length; i++) { if (action['data'].uId == newState[i].uId) { newState.splice(i, 1); break; } } return newState; default: return newState; } }; export default ReducerRight;
import React, { Component } from 'react'; import { connect } from 'react-redux'; import { Field, reduxForm } from 'redux-form'; import PropTypes from 'prop-types'; import Button from '../../common/Button'; import { updateCard } from '../../../actions/boardActions'; class EditCardDescriptionForm extends Component { componentDidMount() { setTimeout(function() { document.querySelector('textarea').focus(); }, 0); } onSubmit = values => { const { updateCard, cardId, authToken, onEdit } = this.props; updateCard(values, cardId, authToken); onEdit(); }; render() { const { handleSubmit, descrAreaHeight } = this.props; return ( <form onSubmit={handleSubmit(this.onSubmit)}> <div className="form-group"> <Field style={{ height: `${descrAreaHeight}px` }} name="description" component="textarea" className="form-control" rows="4" onBlur={handleSubmit(this.onSubmit)} /> </div> <Button classes="btn btn-success" onClick={handleSubmit(this.onSubmit)} title="Add" /> </form> ); } } EditCardDescriptionForm.propTypes = { cardId: PropTypes.string.isRequired, authToken: PropTypes.string.isRequired, updateCard: PropTypes.func.isRequired, handleSubmit: PropTypes.func.isRequired }; const mapStateToProps = ({ auth }) => { return { authToken: auth.authToken }; }; export default reduxForm( (_state, { cardId }) => { return { form: `EditCardDescriptionForm-${cardId}` }; }, { updateCard } )( connect( mapStateToProps, { updateCard } )(EditCardDescriptionForm) );
Template.search.events = { 'keypress #search-box': function (evt, template) { if (evt.which === 13) { var selector = $('#visualizations>ul>input'); var query = template.find("#search-box").value; query = ".*"+ query +".*$"; var result = Visualizations.findOne({"name" : {$regex : query, $options: 'i'}}); //$("div.data").html('<h2>Success! You selected <b>' + result.name+ '</b></h2>'); if (typeof result != 'undefined'){ Session.set("selected", result._id); selector.val(''); } else { selector.val('Sorry, no matches.'); setTimeout(function() {selector.val('');}, 800); } } } };
// FLATTENING FUNCTION const flatten = function(...elements) { let newArray = []; //if element is array create nested loop to loop over array element for (let i = 0; i < elements.length; i++) { if (Array.isArray(elements[i])) { for (let j = 0; j < elements[i].length; j ++) newArray.push(elements[i][j]); } else { newArray.push(elements[i]); } } return newArray; }; // ASSERTION PART const eqArrays = function(arr1, arr2) { let length = arr1.length; for (let i = 0; i < length; i++) { if (arr1[i] !== arr2[i]) return false; } return true; }; // emoji variable to output with assertion let emoji = require('node-emoji'); const assertArraysEqual = function(actual, expected) { // check if 2 passsed arguments are equal if (eqArrays(actual, expected)) { console.log(emoji.get('heart'), ` Assertion Passed: ${actual} === ${expected}`); } else { console.log(emoji.get('warning'), ` Assertion Failed: ${actual} !== ${expected}`); } }; // TEST FUNCTION assertArraysEqual(flatten([1,2,3], 4, 5, [6]), [1, 2, 3, 4, 5, 6]);
import React, { Component } from 'react' import { Modal, Button, Icon, Dropdown, Table } from 'semantic-ui-react' import { VictoryChart, VictoryLine } from 'victory' // import { ComposableMap, ZoomableGroup, Geographies, Geography } from "react-simple-maps" import './VisualisationModal.css' // import worldMap from '../../static/world-50m' class VisualisationModal extends Component { constructor(props) { super(props) this.state = { data: null, selectedIndicators: [] } } componentDidMount() { const { geography } = this.props fetch(`https://jp-17-harjot1singh.c9users.io:8081/api/country/${geography.id}`) .then(response => response.json()) .then(({ indicators }) => this.setState({ data: indicators })) } close = () => { this.props.onHide() } renderData() { const { data, selectedIndicators } = this.state console.log(data) const indicators = Object.keys(data) return ( <div> {selectedIndicators.length === 0 && <Table celled> <Table.Header> <Table.Row> <Table.HeaderCell>Getting Better</Table.HeaderCell> <Table.HeaderCell>Getting Worse</Table.HeaderCell> </Table.Row> </Table.Header> <Table.Body> <Table.Row> <Table.Cell positive>Demand for family planning satisfied by modern methods</Table.Cell> <Table.Cell negative>Women giving birth by age 18</Table.Cell> </Table.Row> <Table.Row> <Table.Cell positive>Women who decide themselves how their earnings are used</Table.Cell> <Table.Cell negative>Women who are literate</Table.Cell> </Table.Row> <Table.Row> <Table.Cell positive>Women with secondary or higher education</Table.Cell> <Table.Cell negative>Women giving birth by age 15</Table.Cell> </Table.Row> </Table.Body> </Table> } {selectedIndicators.length > 0 && selectedIndicators.map(indicator => this.renderGraph(indicator)) } <Dropdown onChange={(e, {value}) => this.setState({selectedIndicators: value})} placeholder='Indicators' fluid multiple selection options={indicators.map(e => ({key:e, text:e, value:e}))}></Dropdown> </div> ) } renderGraph(indicator) { const { data, selectedIndicators } = this.state const filteredData = Object.values(Object.keys(data) .filter(key => key === indicator) .reduce((obj, key) => { obj[key] = data[key]; return obj; }, {})) // const x = Object.entries(filteredData).reduce((acc, [year, vals]) => { // }, ) // console.log(filteredData) const newData = []; for (var index in filteredData) { const filter = filteredData[index]; const newFilter = {} for (var yearName in filter) { const year = filter[yearName]; const y = {}; for (var g in year) { y[year[g]] = g; } newFilter[yearName] = y; } newData[index] = newFilter; } console.log(newData) return ( <div key={indicator}> <p>{indicator}</p> <VictoryChart domain={{y:[0, 100]}} height={200}> <VictoryLine /> <VictoryLine /> </VictoryChart> </div> ) } render() { const { geography, show, countries } = this.props const { data } = this.state return ( <Modal open={true} onClose={this.close} closeIcon> <Modal.Header>{geography.properties.name}</Modal.Header> <Modal.Content> {data ? this.renderData() : <h2> Loading Data </h2>} </Modal.Content> <Modal.Actions> <Button color='green' onClick={this.handleCompare}><Icon name='tasks' /> Compare</Button> <Button color='yellow'><Icon name='dashboard' /> Indicators</Button> <Button color='blue' onClick={this.close}><Icon name='close' /> Close</Button> </Modal.Actions> </Modal> ) } } export default VisualisationModal
import React from 'react'; import { API } from 'aws-amplify'; const FetchDataButton = () => { const fetchData = async () => { let result; try { result = await API.get('polzeeApi', 'generateToken'); console.log('toddtest result', result); } catch(ex) { console.log('caught exception: ', ex); } } return ( <div> <button onClick={fetchData}>click me</button> </div> ) } export default FetchDataButton;
export const data = { "notes": { "note1": { "subject": "this is a subject", "created": 1480446094009, "lastUpdated": 1480446094009, "body": { "text": "This is the body text" } }, "note2": { "subject": "this is another subject", "created": 1480446094009, "lastUpdated": 1480446094009, "body": { "text": "This is also body text" } } } };
import { document } from "document"; export function MicrosUI() { this.busList = document.getElementById("busList"); this.statusText = document.getElementById("status"); } MicrosUI.prototype.updateUI = function(state, schedule) { }
const productDatabase = require('../database/productDatabase').productDatabase class Product { constructor() { this.productDatabase = productDatabase } getAllProduct() { return this.productDatabase } addProduct(product) { this.productDatabase.push(product) return this.productDatabase } searchProduct(product) { return this.productDatabase.find((p)=>{ return p.name == product.name }) } updateProduct(product) { var i =0 this.productDatabase.forEach(prod=>{ if(prod.name==product.name) { this.productDatabase[i] = product } i++ }) this.productDatabase } } module.exports.productClass = Product
var results = [ { "name": "#0" }, { "name": "+Globosat" }, { "name": "1+1" }, { "name": "13th Street Germany" }, { "name": "13ème rue" }, { "name": "1UP.com" }, { "name": "20th Century Fox" }, { "name": "24" }, { "name": "2be" }, { "name": "2×2" }, { "name": "3+" }, { "name": "360" }, { "name": "3sat" }, { "name": "5Star" }, { "name": "7mate" }, { "name": "A Haber" }, { "name": "A&amp;E" }, { "name": "A+" }, { "name": "ABC" }, { "name": "ABC (AU)" }, { "name": "ABC (Australia)" }, { "name": "ABC (JA)" }, { "name": "ABC (US)" }, { "name": "ABC Australia" }, { "name": "ABC Family" }, { "name": "ABC News 24" }, { "name": "ABC TV Australia" }, { "name": "ABC iview" }, { "name": "ABC1" }, { "name": "ABC2" }, { "name": "ABC3" }, { "name": "ABC4Kids" }, { "name": "ABS-CBN Broadcasting Company" }, { "name": "AHC" }, { "name": "ALT Balaji" }, { "name": "AMC" }, { "name": "ANT1" }, { "name": "AOL" }, { "name": "APTN" }, { "name": "ARD" }, { "name": "ART TV" }, { "name": "ARTV" }, { "name": "ARY Digital" }, { "name": "AT-X" }, { "name": "ATV" }, { "name": "ATV (BE)" }, { "name": "ATV (HK)" }, { "name": "ATV Türkiye" }, { "name": "AVRO" }, { "name": "AVROTROS" }, { "name": "AXN" }, { "name": "AXS TV" }, { "name": "Aaj TV" }, { "name": "Abu Dhabi TV" }, { "name": "Acorn TV" }, { "name": "Action" }, { "name": "Adult Channel" }, { "name": "Adult Swim" }, { "name": "Aftenposten" }, { "name": "Aizo TV" }, { "name": "Al Alam" }, { "name": "Al Arabiyya" }, { "name": "Al Jazeera" }, { "name": "Al Jazeera America" }, { "name": "Al-Jamahiriya TV" }, { "name": "AlloCiné" }, { "name": "Alpha TV" }, { "name": "Amazon" }, { "name": "Amazon (Japan)" }, { "name": "America One Television Network" }, { "name": "América TV" }, { "name": "Anhui TV" }, { "name": "Animal Planet" }, { "name": "Animax" }, { "name": "Anime Network" }, { "name": "Anime OAV" }, { "name": "Antena 3" }, { "name": "Antenne 2" }, { "name": "Apple Music" }, { "name": "Arena" }, { "name": "Arirang TV" }, { "name": "Arte" }, { "name": "Arte Creative" }, { "name": "Audience Network" }, { "name": "Australian Christian Channel" }, { "name": "B4U Movies" }, { "name": "B4U Music" }, { "name": "B92" }, { "name": "BBC" }, { "name": "BBC ALBA" }, { "name": "BBC America" }, { "name": "BBC Canada" }, { "name": "BBC Channel 4" }, { "name": "BBC Choice" }, { "name": "BBC Five" }, { "name": "BBC Four" }, { "name": "BBC HD" }, { "name": "BBC Kids" }, { "name": "BBC News" }, { "name": "BBC One" }, { "name": "BBC One Scotland" }, { "name": "BBC Parliament" }, { "name": "BBC Prime" }, { "name": "BBC Three" }, { "name": "BBC Two" }, { "name": "BBC World News" }, { "name": "BBC iPlayer" }, { "name": "BET" }, { "name": "BIP" }, { "name": "BNN" }, { "name": "BNN (NL)" }, { "name": "BNN-VARA" }, { "name": "BNT1" }, { "name": "BR" }, { "name": "BR-alpha" }, { "name": "BRB International" }, { "name": "BRT" }, { "name": "BRT2" }, { "name": "BRTN" }, { "name": "BS Fuji" }, { "name": "BS-i" }, { "name": "BS11" }, { "name": "BYU Television" }, { "name": "BabyFirstTV" }, { "name": "Bandai Channel" }, { "name": "Belgische Radio en Televisie (BRTN)" }, { "name": "Big Ten Network (BTN)" }, { "name": "Biography Channel" }, { "name": "Blackpills" }, { "name": "Blip" }, { "name": "Bloomberg Television" }, { "name": "BluTV" }, { "name": "Boomerang" }, { "name": "Bounce TV" }, { "name": "Bravo" }, { "name": "Bravo (CA)" }, { "name": "Bravo (NZ)" }, { "name": "Bravo (UK)" }, { "name": "Bravo (US)" }, { "name": "Bt-x" }, { "name": "C More" }, { "name": "C-Span" }, { "name": "C31" }, { "name": "C8" }, { "name": "CBBC" }, { "name": "CBC" }, { "name": "CBC (CA)" }, { "name": "CBC (JP)" }, { "name": "CBC News Network" }, { "name": "CBS" }, { "name": "CBS All Access" }, { "name": "CBS Reality (UK)" }, { "name": "CBeebies" }, { "name": "CCTV" }, { "name": "CGV" }, { "name": "CHOCO TV" }, { "name": "CI" }, { "name": "CITV" }, { "name": "CLT" }, { "name": "CMT" }, { "name": "CNBC" }, { "name": "CNBC TV18" }, { "name": "CNN" }, { "name": "CNNI" }, { "name": "CPAC" }, { "name": "CRTV" }, { "name": "CSTV" }, { "name": "CTC (JA)" }, { "name": "CTC (RU)" }, { "name": "CTS" }, { "name": "CTV" }, { "name": "CTV (CN)" }, { "name": "CTV (JP)" }, { "name": "CTV (TW)" }, { "name": "CTi TV" }, { "name": "CW Seed" }, { "name": "Canadian Learning Television" }, { "name": "Canal 10 Saeta" }, { "name": "Canal 13" }, { "name": "Canal 5" }, { "name": "Canal 9 (AR)" }, { "name": "Canal Brasil" }, { "name": "Canal D" }, { "name": "Canal J" }, { "name": "Canal Once" }, { "name": "Canal Plus" }, { "name": "Canal Q" }, { "name": "Canal Sony" }, { "name": "Canal Sur" }, { "name": "Canal Vie" }, { "name": "Canal de las Estrellas" }, { "name": "Canal+" }, { "name": "Canal+ (ES)" }, { "name": "Canal+ (FR)" }, { "name": "Canal+ Cyfrowy" }, { "name": "Canale 5" }, { "name": "Canvas/Ketnet" }, { "name": "Caracol TV" }, { "name": "Carlton Television" }, { "name": "Cartoon Hangover" }, { "name": "Cartoon Network" }, { "name": "Cartoon Network (UK)" }, { "name": "Cartoon Network Australia" }, { "name": "Cartoonito" }, { "name": "Casa" }, { "name": "Centric" }, { "name": "Challenge" }, { "name": "Channel 101" }, { "name": "Channel 2" }, { "name": "Channel 3" }, { "name": "Channel 4" }, { "name": "Channel 5" }, { "name": "Channel 5 (England)" }, { "name": "Channel 5 (SG)" }, { "name": "Channel 5 (TH)" }, { "name": "Channel 5 (UK)" }, { "name": "Channel 7" }, { "name": "Channel 8" }, { "name": "Channel 8 (TH)" }, { "name": "Channel 9" }, { "name": "Channel A" }, { "name": "Channel U" }, { "name": "Channel [V]" }, { "name": "Chilevisión" }, { "name": "Choice" }, { "name": "Christian Broadcasting Network" }, { "name": "Chubu-Nippon Broadcasting" }, { "name": "Cielo" }, { "name": "CineMax" }, { "name": "City" }, { "name": "Club Illico" }, { "name": "Club RTL" }, { "name": "Colors" }, { "name": "Comedy (CA)" }, { "name": "Comedy Central" }, { "name": "Comedy Central (Latin America)" }, { "name": "Comedy Central (UK)" }, { "name": "Comedy Central (US)" }, { "name": "Comedy Channel" }, { "name": "Comic-Con HQ" }, { "name": "Community Channel" }, { "name": "Comédie+" }, { "name": "Cooking Channel" }, { "name": "Cosmopolitan TV" }, { "name": "Coture" }, { "name": "Court TV" }, { "name": "Crackle" }, { "name": "CraveTV" }, { "name": "Crime &amp; Investigation Network" }, { "name": "Crime &amp; Investigation Network (AU)" }, { "name": "Crime &amp; Investigation Network (Europe)" }, { "name": "Crime &amp; Investigation Network (UK)" }, { "name": "Crime &amp; Investigation Network (US)" }, { "name": "Cuatro" }, { "name": "CuriosityStream" }, { "name": "Current TV" }, { "name": "D8" }, { "name": "DC Universe" }, { "name": "DDR1" }, { "name": "DIY Network" }, { "name": "DMAX" }, { "name": "DMAX (DE)" }, { "name": "DMAX (IT)" }, { "name": "DR" }, { "name": "DR K" }, { "name": "DR Ramasjang" }, { "name": "DR1" }, { "name": "DR2" }, { "name": "DR3" }, { "name": "DRAMAcube" }, { "name": "DSF" }, { "name": "Dailymotion" }, { "name": "Danmarks Radio" }, { "name": "Dark" }, { "name": "Das Erste" }, { "name": "Daum tvPot" }, { "name": "Dave" }, { "name": "Destination America" }, { "name": "Deutsche Welle TV" }, { "name": "DirecTV Japan" }, { "name": "Direct to DVD" }, { "name": "Discovery" }, { "name": "Discovery (NL)" }, { "name": "Discovery (US)" }, { "name": "Discovery Canada" }, { "name": "Discovery Channel (AU)" }, { "name": "Discovery Channel (Asia)" }, { "name": "Discovery Channel (Australia)" }, { "name": "Discovery Channel (CA)" }, { "name": "Discovery Channel (Canada)" }, { "name": "Discovery Channel (Poland)" }, { "name": "Discovery Channel (SE)" }, { "name": "Discovery Channel (UK)" }, { "name": "Discovery Channel Canada" }, { "name": "Discovery Chnnel" }, { "name": "Discovery Family" }, { "name": "Discovery HD World" }, { "name": "Discovery Health" }, { "name": "Discovery Health Channel" }, { "name": "Discovery History" }, { "name": "Discovery Kids" }, { "name": "Discovery Life" }, { "name": "Discovery MAX" }, { "name": "Discovery Science" }, { "name": "Discovery Shed" }, { "name": "Discovery Turbo" }, { "name": "Discovery Turbo UK" }, { "name": "Dish TV" }, { "name": "Disney Channel" }, { "name": "Disney Channel (BR)" }, { "name": "Disney Channel (DE)" }, { "name": "Disney Channel (IT)" }, { "name": "Disney Channel (Latin America)" }, { "name": "Disney Channel (UK)" }, { "name": "Disney Channel (US)" }, { "name": "Disney Cinemagic" }, { "name": "Disney Junior" }, { "name": "Disney Junior (UK)" }, { "name": "Disney XD" }, { "name": "Disney XD (Latin America)" }, { "name": "Dlife" }, { "name": "Doordarshan National" }, { "name": "Doordarshan News" }, { "name": "Dragon TV" }, { "name": "DramaH" }, { "name": "DramaX" }, { "name": "DuMont Television Network" }, { "name": "Duna TV" }, { "name": "E!" }, { "name": "E! (CA)" }, { "name": "E-Channel" }, { "name": "E4" }, { "name": "EBS" }, { "name": "EO" }, { "name": "EPIC TV" }, { "name": "EPIX" }, { "name": "ERT" }, { "name": "ESPN" }, { "name": "ESPN Classic" }, { "name": "ESPN India" }, { "name": "ESPN2" }, { "name": "ETB1" }, { "name": "ETB2" }, { "name": "ETV" }, { "name": "Echorouk TV" }, { "name": "Eden" }, { "name": "EinsPlus" }, { "name": "Einsfestival" }, { "name": "El Djazairia One" }, { "name": "El Khabar Broadcasting Company (KBC)" }, { "name": "El Rey Network" }, { "name": "El Trece" }, { "name": "Eleven" }, { "name": "Encore" }, { "name": "Encuentro" }, { "name": "Epsilon TV" }, { "name": "Eros Now" }, { "name": "Esquire Network" }, { "name": "European Broadcasting Union (EBU)" }, { "name": "Eurosport" }, { "name": "Explora" }, { "name": "FEARNet" }, { "name": "FEM" }, { "name": "FOX" }, { "name": "FOX (US)" }, { "name": "FOX Sports 1" }, { "name": "FOX Traveller" }, { "name": "FOX Türkiye" }, { "name": "FOX Türkiye (TR)" }, { "name": "FOX+" }, { "name": "FSN" }, { "name": "FTV" }, { "name": "FTV, Nova" }, { "name": "FUNimation Channel" }, { "name": "FX" }, { "name": "FX (Latin America)" }, { "name": "FX (US)" }, { "name": "FXX" }, { "name": "FYI" }, { "name": "Facebook Live" }, { "name": "Facebook Watch" }, { "name": "Family" }, { "name": "Family (CA)" }, { "name": "Family CHRGD" }, { "name": "Family Gekijo" }, { "name": "Fashion" }, { "name": "Fashion TV" }, { "name": "Feeln" }, { "name": "FilmOn.tv" }, { "name": "Five" }, { "name": "Five Life" }, { "name": "Five US" }, { "name": "Fix &amp; Foxi" }, { "name": "Flooxer" }, { "name": "Food Network" }, { "name": "Food Network Canada" }, { "name": "FoodTV" }, { "name": "Fox (Latin America)" }, { "name": "Fox 1 (Brazil)" }, { "name": "Fox Action Movies" }, { "name": "Fox Business" }, { "name": "Fox Channel (BR)" }, { "name": "Fox Channel (FI)" }, { "name": "Fox Channel (IT)" }, { "name": "Fox Channel (UK)" }, { "name": "Fox Cinéma" }, { "name": "Fox Crime" }, { "name": "Fox España" }, { "name": "Fox Family" }, { "name": "Fox Kids" }, { "name": "Fox Life (BR)" }, { "name": "Fox Life (IT)" }, { "name": "Fox Life (Latin America)" }, { "name": "Fox Reality" }, { "name": "Fox Sports" }, { "name": "Fox Sports (AU)" }, { "name": "Fox Sports 2" }, { "name": "Fox Sports Net" }, { "name": "Fox8" }, { "name": "Foxsports" }, { "name": "France 2" }, { "name": "France 3" }, { "name": "France 4" }, { "name": "France 5" }, { "name": "France Ô" }, { "name": "Freeform" }, { "name": "Fuel TV" }, { "name": "Fuji TV" }, { "name": "Fuji Television" }, { "name": "Fullscreen" }, { "name": "Fuse" }, { "name": "Fuse TV" }, { "name": "Fusion" }, { "name": "G4" }, { "name": "G4 Canada" }, { "name": "G4TechTV Canada" }, { "name": "GMA" }, { "name": "GMM One" }, { "name": "GNT" }, { "name": "GSN" }, { "name": "GTV" }, { "name": "Gaiam TV " }, { "name": "Geo TV" }, { "name": "Global" }, { "name": "GloboNews" }, { "name": "Globoplay" }, { "name": "Gloob" }, { "name": "Golf Channel" }, { "name": "Great American Country" }, { "name": "Gulli" }, { "name": "H2" }, { "name": "HBO" }, { "name": "HBO - BBC" }, { "name": "HBO Asia" }, { "name": "HBO Canada" }, { "name": "HBO Europe" }, { "name": "HBO Latin America" }, { "name": "HBO Magyarország" }, { "name": "HBO Nordic" }, { "name": "HDNet" }, { "name": "HGTV" }, { "name": "HGTV Canada" }, { "name": "HIFI" }, { "name": "HKTV" }, { "name": "HLN" }, { "name": "HOT" }, { "name": "Hakka TV" }, { "name": "Hallmark Channel" }, { "name": "Hessischer Rundfunk" }, { "name": "Histoire" }, { "name": "Historia (CA)" }, { "name": "Historia (ES)" }, { "name": "History" }, { "name": "History (CA)" }, { "name": "History (UK)" }, { "name": "History Channel (UK)" }, { "name": "History International" }, { "name": "History Television" }, { "name": "Hoichoi" }, { "name": "Hrvatska radiotelevizija" }, { "name": "Hulu" }, { "name": "Hum TV" }, { "name": "Hunan TV" }, { "name": "ICI Tou.tv" }, { "name": "ICTV" }, { "name": "IFC" }, { "name": "INSP" }, { "name": "IPTV | Downloadable Show" }, { "name": "IRIB TV1" }, { "name": "ITV" }, { "name": "ITV 1" }, { "name": "ITV Encore" }, { "name": "ITV Granada" }, { "name": "ITV London" }, { "name": "ITV Wales" }, { "name": "ITV1" }, { "name": "ITV2" }, { "name": "ITV3" }, { "name": "ITV4" }, { "name": "ITVBe" }, { "name": "Indus Music" }, { "name": "Internet" }, { "name": "Investigation Discovery" }, { "name": "Ion Television" }, { "name": "Italia 1" }, { "name": "JIM" }, { "name": "JOJ" }, { "name": "Jetix" }, { "name": "Jeuxvideo.com" }, { "name": "Jiangsu TV" }, { "name": "Joi" }, { "name": "Jupiter Broadcasting" }, { "name": "KBS" }, { "name": "KBS Kyoto" }, { "name": "KBS TV1" }, { "name": "KBS TV2" }, { "name": "KBS World" }, { "name": "KCET" }, { "name": "KIKA" }, { "name": "KKTV" }, { "name": "KPN Presenteert" }, { "name": "KRO" }, { "name": "KRO / NCRV" }, { "name": "KRO-NCRV" }, { "name": "KSS" }, { "name": "KTN" }, { "name": "KTV" }, { "name": "KVOS" }, { "name": "Kabel eins" }, { "name": "Kanaal 2" }, { "name": "KanaalTwee" }, { "name": "Kanal 4" }, { "name": "Kanal 4 (DK)" }, { "name": "Kanal 5" }, { "name": "Kanal 5 (DK)" }, { "name": "Kanal 5 (SE)" }, { "name": "Kanal 7" }, { "name": "Kanal D" }, { "name": "Kansai TV" }, { "name": "Kids Station" }, { "name": "Kunskapskanalen" }, { "name": "Kyoto Broadcasting System" }, { "name": "Kyushu Asahi Broadcasting" }, { "name": "Kyushu Asahi Broadcasting (KBC)" }, { "name": "L Équipe 21" }, { "name": "LINE TV (TH)" }, { "name": "LMN" }, { "name": "LNK TV" }, { "name": "LOGO" }, { "name": "La 2" }, { "name": "La 2 (TVE2)" }, { "name": "La Cinq" }, { "name": "La Deux" }, { "name": "La Red" }, { "name": "La Une" }, { "name": "La Uno (TVE1)" }, { "name": "La sexta" }, { "name": "La1 de TVE" }, { "name": "La5" }, { "name": "La7" }, { "name": "LaSexta" }, { "name": "Life Network" }, { "name": "Life OK" }, { "name": "LifeStyle" }, { "name": "LifeStyle FOOD" }, { "name": "LifeStyle HOME" }, { "name": "Lifetime" }, { "name": "Lifetime (UK)" }, { "name": "Lifetime (US)" }, { "name": "Line TV" }, { "name": "Living" }, { "name": "LivingTV" }, { "name": "Locomotion" }, { "name": "London Weekend Television" }, { "name": "London Weekend Television (LWT)" }, { "name": "M-Net" }, { "name": "M6" }, { "name": "MATV" }, { "name": "MAX" }, { "name": "MBC" }, { "name": "MBC 1" }, { "name": "MBC Drama" }, { "name": "MBC Every 1" }, { "name": "MBC Every1" }, { "name": "MBC Plus Media" }, { "name": "MBN" }, { "name": "MBS" }, { "name": "MCE TV (Ma Chaîne Étudiante)" }, { "name": "MCM" }, { "name": "MCOT" }, { "name": "MDR" }, { "name": "MEGA TV" }, { "name": "MLB Network" }, { "name": "MNN" }, { "name": "MSNBC" }, { "name": "MTV" }, { "name": "MTV (CA)" }, { "name": "MTV (FR)" }, { "name": "MTV (PL)" }, { "name": "MTV (UK)" }, { "name": "MTV (US)" }, { "name": "MTV Base" }, { "name": "MTV Brazil" }, { "name": "MTV España" }, { "name": "MTV Italia" }, { "name": "MTV Latin America" }, { "name": "MTV Live" }, { "name": "MTV network" }, { "name": "MTV2" }, { "name": "MTV3" }, { "name": "MUTV" }, { "name": "Magic" }, { "name": "Magyar Televízió" }, { "name": "Mango TV" }, { "name": "MavTV" }, { "name": "Maxdome" }, { "name": "Mega" }, { "name": "Mega Channel" }, { "name": "Men &amp; Motor" }, { "name": "Men &amp; Motors" }, { "name": "Military Channel" }, { "name": "Mnet" }, { "name": "Moi &amp; Cie" }, { "name": "Mojo" }, { "name": "Mojo HD" }, { "name": "Mondo TV" }, { "name": "MoonTV" }, { "name": "More4" }, { "name": "Movie Central" }, { "name": "Movie Extra (Australia)" }, { "name": "Movistar+" }, { "name": "Much (CA)" }, { "name": "MuchMusic" }, { "name": "Multishow" }, { "name": "MusiquePlus" }, { "name": "MyNetworkTV" }, { "name": "Mya" }, { "name": "Māori Television" }, { "name": "NAVER tvcast" }, { "name": "NBA TV" }, { "name": "NBC" }, { "name": "NBC Universo" }, { "name": "NBCSN" }, { "name": "NCRV" }, { "name": "NDR" }, { "name": "NDTV India" }, { "name": "NECO" }, { "name": "NED3" }, { "name": "NET" }, { "name": "NET 5" }, { "name": "NET5 &amp; VT4" }, { "name": "NFL Network" }, { "name": "NHK" }, { "name": "NHK Animax" }, { "name": "NHNZ" }, { "name": "NOS" }, { "name": "NOVE" }, { "name": "NPO 3" }, { "name": "NPR" }, { "name": "NPS" }, { "name": "NRJ 12" }, { "name": "NRK" }, { "name": "NRK Super" }, { "name": "NRK1" }, { "name": "NRK2" }, { "name": "NRK3" }, { "name": "NT1" }, { "name": "NTR" }, { "name": "NTV" }, { "name": "NTV (JP)" }, { "name": "Nagoya Broadcasting Network" }, { "name": "Nat Geo Wild" }, { "name": "National Geographic" }, { "name": "National Geographic (AU)" }, { "name": "National Geographic (UK)" }, { "name": "National Geographic (US)" }, { "name": "National Geographic Adventure" }, { "name": "National Geographic Channel" }, { "name": "National Geographiс" }, { "name": "Nature" }, { "name": "Nederland 3" }, { "name": "Nelonen" }, { "name": "Netflix" }, { "name": "Network 10 Australia" }, { "name": "Network Ten" }, { "name": "Nick" }, { "name": "Nick Jr." }, { "name": "Nick at Nite" }, { "name": "NickToons" }, { "name": "NickToons Network" }, { "name": "Nickelodeon" }, { "name": "Nickelodeon (Latin America)" }, { "name": "Nico Nico Douga" }, { "name": "Niconico" }, { "name": "Nine (Australia)" }, { "name": "Nine Network" }, { "name": "Nippon Housou Kyoukai" }, { "name": "Nippon Television" }, { "name": "Nitro" }, { "name": "Noggin" }, { "name": "Nolife" }, { "name": "Nou Televisió" }, { "name": "Nova" }, { "name": "NovaTV" }, { "name": "Now TV" }, { "name": "Numéro 23" }, { "name": "OCN" }, { "name": "OCS" }, { "name": "OLN" }, { "name": "ONDirecTV (Latin America)" }, { "name": "ORF" }, { "name": "ORF 1" }, { "name": "ORF 2" }, { "name": "ORF III" }, { "name": "ORTF" }, { "name": "OUFtivi" }, { "name": "OVA" }, { "name": "OWN" }, { "name": "Oasis HD" }, { "name": "Off The Fence" }, { "name": "Olive" }, { "name": "Omni" }, { "name": "Omroep Brabant" }, { "name": "Omroep MAX" }, { "name": "On Networks" }, { "name": "OnStyle" }, { "name": "Online" }, { "name": "Online - www.cad-series.com" }, { "name": "Oprah Winfrey Network" }, { "name": "Ora TV" }, { "name": "OutTV" }, { "name": "Outdoor Channel" }, { "name": "Outdoor Life Network" }, { "name": "Ovation TV" }, { "name": "Oxygen" }, { "name": "PBS" }, { "name": "PBS Kids" }, { "name": "PBS Kids Sprout" }, { "name": "PC.MAG.com Network" }, { "name": "PPTV" }, { "name": "PRIMA TV" }, { "name": "PRO TV" }, { "name": "PTS" }, { "name": "PTS HD" }, { "name": "PTV Home" }, { "name": "Pakapaka" }, { "name": "Paramount Comedy" }, { "name": "Paramount Network" }, { "name": "Paris Première" }, { "name": "Phoenix" }, { "name": "Pick TV" }, { "name": "Pink Pineapple" }, { "name": "Pivot" }, { "name": "Planet Green" }, { "name": "Planète+" }, { "name": "Play More" }, { "name": "Play UK" }, { "name": "Play UK, BBC Choice" }, { "name": "PlayStation Network" }, { "name": "Playboy TV" }, { "name": "Playhouse Disney" }, { "name": "Playhouse Disney France" }, { "name": "Playz" }, { "name": "Polsat" }, { "name": "Polynésie 1ère" }, { "name": "Pop" }, { "name": "PowNed" }, { "name": "Prima televize" }, { "name": "Prime (BE)" }, { "name": "Prime (NZ)" }, { "name": "ProSieben" }, { "name": "ProSieben Maxx" }, { "name": "Prva Srpska Televizija" }, { "name": "Puls 4" }, { "name": "Q TV" }, { "name": "QTV" }, { "name": "Qatar TV" }, { "name": "Quest" }, { "name": "R&amp;R" }, { "name": "RAI" }, { "name": "RAI Fiction" }, { "name": "RBB" }, { "name": "RCN TV" }, { "name": "RCTI" }, { "name": "RCTV" }, { "name": "RDI" }, { "name": "RED+" }, { "name": "RMC Découverte" }, { "name": "RT" }, { "name": "RTB" }, { "name": "RTBF" }, { "name": "RTF Télévision" }, { "name": "RTL" }, { "name": "RTL 2" }, { "name": "RTL 4" }, { "name": "RTL 5" }, { "name": "RTL 7" }, { "name": "RTL 8" }, { "name": "RTL II" }, { "name": "RTL Klub" }, { "name": "RTL TVI" }, { "name": "RTL Television" }, { "name": "RTL Televizija" }, { "name": "RTL2" }, { "name": "RTP N" }, { "name": "RTP Play" }, { "name": "RTP1" }, { "name": "RTP2" }, { "name": "RTS 1" }, { "name": "RTS Un" }, { "name": "RTS1" }, { "name": "RTV Noord Holland" }, { "name": "RTV Slovenija" }, { "name": "RTVS" }, { "name": "RTÉ" }, { "name": "RTÉ One" }, { "name": "RTÉ Two" }, { "name": "RTÉjr" }, { "name": "RVU" }, { "name": "Radio Bremen" }, { "name": "Radio Canada" }, { "name": "Radio-Canada" }, { "name": "Radio-Québec" }, { "name": "Rai 1" }, { "name": "Rai 2" }, { "name": "Rai 3" }, { "name": "Rai 4" }, { "name": "Rai 5" }, { "name": "Rai Gulp" }, { "name": "Rai Uno" }, { "name": "RaiPlay" }, { "name": "RaiUno" }, { "name": "Real Time" }, { "name": "Really" }, { "name": "Record" }, { "name": "Red Bull TV" }, { "name": "Rede Bandeirantes" }, { "name": "Rede Globo" }, { "name": "Rede Manchete" }, { "name": "RedeTV!" }, { "name": "ReelzChannel" }, { "name": "Rete 4" }, { "name": "Revision 3" }, { "name": "Revision3" }, { "name": "Revolt" }, { "name": "RichardDawkins.net" }, { "name": "Rivit TV" }, { "name": "Rooster Teeth" }, { "name": "Rooster Teeth Productions" }, { "name": "Russia Today" }, { "name": "Rúv" }, { "name": "S4/C" }, { "name": "SABC1" }, { "name": "SABC2" }, { "name": "SABC3" }, { "name": "SAT.1" }, { "name": "SBS" }, { "name": "SBS (AU)" }, { "name": "SBS (KR)" }, { "name": "SBS 6" }, { "name": "SBS Plus" }, { "name": "SBS6" }, { "name": "SBT" }, { "name": "SEC Network" }, { "name": "SET MAX" }, { "name": "SET Metro" }, { "name": "SET TV" }, { "name": "SIC" }, { "name": "SIC Mulher" }, { "name": "SIC Radical" }, { "name": "SKY PerfecTV!" }, { "name": "SOAPnet" }, { "name": "SRC" }, { "name": "SRF 1" }, { "name": "STAR Chinese Channel" }, { "name": "STAR One" }, { "name": "STAR Plus" }, { "name": "STAR Vijay" }, { "name": "STV" }, { "name": "STV (UK)" }, { "name": "SUN TV" }, { "name": "SUN music" }, { "name": "SVT" }, { "name": "SVT Drama" }, { "name": "SVT1" }, { "name": "SVT2" }, { "name": "SVTB" }, { "name": "SWR" }, { "name": "Sab TV" }, { "name": "Sat 1" }, { "name": "Sat1" }, { "name": "Schweizer Fernsehen" }, { "name": "Sci-Fi" }, { "name": "SciFi" }, { "name": "Science Channel" }, { "name": "Seeso" }, { "name": "Servus TV" }, { "name": "Setanta Ireland" }, { "name": "Seven Network" }, { "name": "Señal Colombia" }, { "name": "Shandong Television" }, { "name": "Shenzhen TV" }, { "name": "Show TV" }, { "name": "ShowMax" }, { "name": "Showcase" }, { "name": "Showcase (AU)" }, { "name": "Showcase (CA)" }, { "name": "Showtime" }, { "name": "Sixx" }, { "name": "Sjónvarp Símans" }, { "name": "Skai" }, { "name": "Sky" }, { "name": "Sky Arts" }, { "name": "Sky Atlantic (IT)" }, { "name": "Sky Atlantic (UK)" }, { "name": "Sky Box Office" }, { "name": "Sky Cinema" }, { "name": "Sky Cinema (IT)" }, { "name": "Sky Cinema (UK)" }, { "name": "Sky Deutschland" }, { "name": "Sky Living" }, { "name": "Sky News" }, { "name": "Sky Sports" }, { "name": "Sky Three" }, { "name": "Sky Travel" }, { "name": "Sky Uno" }, { "name": "Sky1" }, { "name": "Sky2" }, { "name": "Sky3" }, { "name": "Slash" }, { "name": "Sleuth" }, { "name": "Slice" }, { "name": "Smithsonian Channel" }, { "name": "Smithsonian Channel (CA)" }, { "name": "SoHo" }, { "name": "Sony" }, { "name": "Sony Crackle" }, { "name": "Sony Entertainment Television" }, { "name": "Sony TV" }, { "name": "Southern TV" }, { "name": "Space" }, { "name": "Space (Brasil)" }, { "name": "Space (Latin America)" }, { "name": "Speed" }, { "name": "Speed Network" }, { "name": "Spektrum" }, { "name": "Spike TV" }, { "name": "Sportsman Channel" }, { "name": "Stan" }, { "name": "Star Bharat" }, { "name": "Star Media" }, { "name": "Star TV" }, { "name": "Star World" }, { "name": "Starz!" }, { "name": "Studio 100 TV" }, { "name": "Studio 4" }, { "name": "Studio Canal" }, { "name": "Studio+" }, { "name": "Style" }, { "name": "Style Network" }, { "name": "Style TV" }, { "name": "Stöð 2" }, { "name": "Stöð 2 Sport" }, { "name": "Sub" }, { "name": "SubTV" }, { "name": "Sun Television" }, { "name": "Sundance" }, { "name": "SundanceTV" }, { "name": "Super Channel" }, { "name": "Super Deluxe" }, { "name": "Super XFM" }, { "name": "Super Écran" }, { "name": "Super!" }, { "name": "SuperRTL" }, { "name": "Sveriges Television" }, { "name": "Swearnet" }, { "name": "Syfy" }, { "name": "Syndicated" }, { "name": "Syndication" }, { "name": "Séries+" }, { "name": "TBN (Trinity Broadcasting Network)" }, { "name": "TBS" }, { "name": "TBS (Latin America)" }, { "name": "TBS Superstation" }, { "name": "TCM" }, { "name": "TED.com" }, { "name": "TET" }, { "name": "TF1" }, { "name": "TFX" }, { "name": "TG4" }, { "name": "TITV" }, { "name": "TLC" }, { "name": "TMC" }, { "name": "TMF" }, { "name": "TNT" }, { "name": "TNT (US)" }, { "name": "TNT Brasil" }, { "name": "TNT Latin America" }, { "name": "TNT Serie" }, { "name": "TNU" }, { "name": "TQS" }, { "name": "TROS" }, { "name": "TRT 1" }, { "name": "TRT Belgesel" }, { "name": "TRT Haber" }, { "name": "TRT Çocuk" }, { "name": "TSN" }, { "name": "TTC" }, { "name": "TTV" }, { "name": "TTV (PL)" }, { "name": "TV 2" }, { "name": "TV 2 Charlie" }, { "name": "TV 2 Science Fiction" }, { "name": "TV 2 Zebra" }, { "name": "TV 2 Zulu" }, { "name": "TV 3" }, { "name": "TV 4" }, { "name": "TV Aichi" }, { "name": "TV Asahi" }, { "name": "TV Asashi" }, { "name": "TV Azteca" }, { "name": "TV Brasil" }, { "name": "TV Chile" }, { "name": "TV Cultura" }, { "name": "TV Guide Channel" }, { "name": "TV Kanagawa" }, { "name": "TV Land" }, { "name": "TV Markíza" }, { "name": "TV Norge" }, { "name": "TV Nova" }, { "name": "TV One" }, { "name": "TV One (NZ)" }, { "name": "TV One (US)" }, { "name": "TV Osaka" }, { "name": "TV Pública" }, { "name": "TV Saitama" }, { "name": "TV Slovenija" }, { "name": "TV Tokyo" }, { "name": "TV Vest" }, { "name": "TV1" }, { "name": "TV11" }, { "name": "TV2" }, { "name": "TV2 (NO)" }, { "name": "TV2 (NZ)" }, { "name": "TV2 Norway" }, { "name": "TV2 Zulu" }, { "name": "TV3" }, { "name": "TV3 (ES)" }, { "name": "TV3 (IE)" }, { "name": "TV3 (NO)" }, { "name": "TV3 (NZ)" }, { "name": "TV3 (SE)" }, { "name": "TV3 Puls" }, { "name": "TV3+" }, { "name": "TV4" }, { "name": "TV4 (NZ)" }, { "name": "TV4 (SE)" }, { "name": "TV4 Fakta" }, { "name": "TV4 Plus" }, { "name": "TV400" }, { "name": "TV5 (CA)" }, { "name": "TV5 (FI)" }, { "name": "TV5 Monde" }, { "name": "TV6" }, { "name": "TV7" }, { "name": "TV7 (BG)" }, { "name": "TV7 (SE)" }, { "name": "TV8" }, { "name": "TV8 (IT)" }, { "name": "TV9" }, { "name": "TVA" }, { "name": "TVA (JP)" }, { "name": "TVB" }, { "name": "TVBS" }, { "name": "TVBS Entertainment Channel" }, { "name": "TVE" }, { "name": "TVG Network" }, { "name": "TVGN" }, { "name": "TVI" }, { "name": "TVM" }, { "name": "TVN" }, { "name": "TVN Style" }, { "name": "TVN Turbo" }, { "name": "TVNZ" }, { "name": "TVNorge" }, { "name": "TVO" }, { "name": "TVOne Global" }, { "name": "TVP" }, { "name": "TVP SA" }, { "name": "TVP1" }, { "name": "TVP2" }, { "name": "TVQ (Japan)" }, { "name": "TVRI" }, { "name": "TVS China" }, { "name": "TVS Sydney" }, { "name": "TWiT" }, { "name": "TYT Network" }, { "name": "Talpa" }, { "name": "TeenNick" }, { "name": "Tele 5" }, { "name": "Telecinco" }, { "name": "Telefe" }, { "name": "Telefuturo" }, { "name": "Telemundo" }, { "name": "Teletama" }, { "name": "Teletoon" }, { "name": "Televisa" }, { "name": "Televisa S.A. de C.V" }, { "name": "Televisa S.A. de C.V." }, { "name": "Television Maldives" }, { "name": "Televisión de Galicia" }, { "name": "Televizija Zagreb" }, { "name": "Tencent Video" }, { "name": "Thames Television" }, { "name": "The 5 Network" }, { "name": "The Africa Channel" }, { "name": "The Africa Channel (UK)" }, { "name": "The Africa Channel (US)" }, { "name": "The Anime Network" }, { "name": "The Austin Systems Channel" }, { "name": "The Box" }, { "name": "The CW" }, { "name": "The Comedy Channel" }, { "name": "The Comedy Network" }, { "name": "The Discovery Channel Canada" }, { "name": "The Family Channel" }, { "name": "The History Channel" }, { "name": "The History Channel International" }, { "name": "The Hub" }, { "name": "The Movie Network" }, { "name": "The N" }, { "name": "The Science Channel" }, { "name": "The Sportsman Channel" }, { "name": "The Travel Channel" }, { "name": "The Verge" }, { "name": "The WB" }, { "name": "The Weather Channel" }, { "name": "This TV" }, { "name": "Toei Channel" }, { "name": "Toggle" }, { "name": "Tokyo Broadcasting System" }, { "name": "Tokyo MX" }, { "name": "TomGreen.com" }, { "name": "Toon Disney" }, { "name": "Tou.tv" }, { "name": "Toute l'histoire" }, { "name": "Travel" }, { "name": "Travel + Escape" }, { "name": "Travel Channel" }, { "name": "Travel Channel (UK)" }, { "name": "Treehouse" }, { "name": "Treehouse TV" }, { "name": "Trend E" }, { "name": "Trinity Broadcasting Network" }, { "name": "TrueID" }, { "name": "TrueVisions" }, { "name": "Turner South" }, { "name": "Twitch" }, { "name": "Télé-Québec" }, { "name": "UK Entertainment Channel" }, { "name": "UK Play" }, { "name": "UKTV Documentary" }, { "name": "UKTV Drama" }, { "name": "UKTV Food" }, { "name": "UKTV G2" }, { "name": "UKTV Gold" }, { "name": "UKTV History" }, { "name": "UKTV Yesterday" }, { "name": "UKTV style" }, { "name": "UP TV" }, { "name": "UPN" }, { "name": "USA Network" }, { "name": "UTV" }, { "name": "Unis TV" }, { "name": "Universal Channel" }, { "name": "Universal Kids" }, { "name": "Univision" }, { "name": "Urdu 1" }, { "name": "Ustream" }, { "name": "V" }, { "name": "V LIVE" }, { "name": "VARA" }, { "name": "VH1" }, { "name": "VH1 Classics" }, { "name": "VIER" }, { "name": "VIJF" }, { "name": "VOX" }, { "name": "VPRO" }, { "name": "VRT" }, { "name": "VRV" }, { "name": "VT4" }, { "name": "VTM" }, { "name": "Velocity" }, { "name": "Venevision" }, { "name": "Veronica" }, { "name": "Versus" }, { "name": "Viafree" }, { "name": "Viaplay" }, { "name": "Viasat 4" }, { "name": "Viasat3" }, { "name": "Viceland" }, { "name": "Viceland (CA)" }, { "name": "Viceland (UK)" }, { "name": "Viceland (US)" }, { "name": "Victor Entertainment" }, { "name": "Videoland (NL)" }, { "name": "Vidol" }, { "name": "VijfTV" }, { "name": "Vimeo" }, { "name": "Virgin 1" }, { "name": "ViuTV" }, { "name": "Viva" }, { "name": "Vrak.TV" }, { "name": "Vuze" }, { "name": "W" }, { "name": "W Network" }, { "name": "W9" }, { "name": "WCNY" }, { "name": "WDR" }, { "name": "WE tv" }, { "name": "WGN America" }, { "name": "WOWOW" }, { "name": "WPIX" }, { "name": "WWE Network" }, { "name": "Warner Channel" }, { "name": "Watch" }, { "name": "WealthTV" }, { "name": "Web" }, { "name": "Wilder" }, { "name": "Womens Entertainment Network" }, { "name": "Workpoint TV" }, { "name": "Worldwide" }, { "name": "Xbox Video" }, { "name": "Xover" }, { "name": "XtvN" }, { "name": "YLE" }, { "name": "YLE TV1" }, { "name": "YLE TV2" }, { "name": "YTV" }, { "name": "YTV (CA)" }, { "name": "YTV (JP)" }, { "name": "YTV (UK)" }, { "name": "Yahoo! Japan" }, { "name": "Yahoo! Screen" }, { "name": "Yomiuri TV" }, { "name": "Yorin" }, { "name": "YouTube" }, { "name": "YouTube Premium" }, { "name": "YouTube Red" }, { "name": "Youku" }, { "name": "ZDF" }, { "name": "ZDF.Kultur" }, { "name": "ZDFinfo" }, { "name": "ZDFneo" }, { "name": "ZTV" }, { "name": "Zee TV" }, { "name": "Zeste" }, { "name": "Zhejiang TV" }, { "name": "Ztélé" }, { "name": "addikTV" }, { "name": "bTV" }, { "name": "comedy" }, { "name": "dk4" }, { "name": "documentary Channel" }, { "name": "e.tv" }, { "name": "element14" }, { "name": "eqhd" }, { "name": "family gekijou (japan)" }, { "name": "france.3" }, { "name": "france.5" }, { "name": "go90" }, { "name": "here!" }, { "name": "http://revision3.com/internetsuperstar/" }, { "name": "http://roosterteeth.com/" }, { "name": "http://www.labrats.tv/" }, { "name": "hulu Japan" }, { "name": "iQiyi" }, { "name": "iTunes" }, { "name": "inDEMAND" }, { "name": "jTBC" }, { "name": "motorsports.tv" }, { "name": "n-tv" }, { "name": "oksusu" }, { "name": "puhutv" }, { "name": "radX" }, { "name": "rmusic TV" }, { "name": "truTV" }, { "name": "tvk" }, { "name": "téva" }, { "name": "vtm.be" }, { "name": "www.purepwnage.com" }, { "name": "www.startrekofgodsandmen.net" }, { "name": "www.welcometothescene.com" }, { "name": "yes" }, { "name": "yes stars ישראלי" }, { "name": "Évasion" }, { "name": "één" }, { "name": "Československá televize" }, { "name": "Česká televize" }, { "name": "ΕΡΤ" }, { "name": "ΕΡΤ 1" }, { "name": "ΕΤ1" }, { "name": "Інтер" }, { "name": "ДТВ" }, { "name": "Дождь" }, { "name": "Домашний" }, { "name": "Звезда" }, { "name": "НТВ" }, { "name": "Первый канал" }, { "name": "Пятый канал" }, { "name": "РЕН" }, { "name": "Радио-телевизија Србије (PTC)" }, { "name": "Россия 1" }, { "name": "Россия К" }, { "name": "СТС" }, { "name": "ТВ Центр" }, { "name": "ТВ3" }, { "name": "ТВС" }, { "name": "ТНТ" }, { "name": "הערוץ הראשון" }, { "name": "טלעד" }, { "name": "ערוץ 10" }, { "name": "ערוץ הילדים&lrm;" }, { "name": "קשת" }, { "name": "קשת 12" }, { "name": "רשת" }, { "name": "ช่อง one" }, { "name": "中央电视台影视部" } ]; //loop through all the items var i = 0; var channels = []; for(i; i<results.length; i++){ var entry = results[i].name; var entryClean = entryClean.split("(")[0]; var item = { "value": entryClean , "synonyms" : [entryClean, entry] }; channels.push(item); } console.log(channels); //save results in a JSON file. //instead of hardcoding data get the results from https://api.trakt.tv/networks //needs trakt-api-key trakt.networks().then();
import * as firebase from "firebase/app"; import "firebase/auth"; import 'firebase/database'; var firebaseConfig = { apiKey: "AIzaSyA0b0BTp5w7Cp-irDa2aDAG56OiCVwp6t4", authDomain: "conectir-1265c.firebaseapp.com", databaseURL: "https://conectir-1265c.firebaseio.com", projectId: "conectir-1265c", storageBucket: "conectir-1265c.appspot.com", messagingSenderId: "893217829184", appId: "1:893217829184:web:39558b74d6e73cad2a0aa5" }; // Initialize Firebase var Firebase = firebase.initializeApp(firebaseConfig); export default Firebase;
const elemento = document.querySelector(".jogo"); const elemParaModal = document.querySelector("#modal"); const telaNaoClicavel = document.querySelector("#tela"); let elementosClicados = []; let cartasClicadasPorRodada = 0; let primeiroId = 0; let segundoId = 0; let pontos = 0; const numeroDePares = defineNumeroDePares(); const tempoAntesDaCartaErradaVirarDeVolta = 2000; const tempoParaAparecerMensagemVitoria = 800; const tempoNaoClicavel = 2000; const tempoParaVirarACarta = 200; const escalaInteira = "scale(1)"; const escalaEnquantoCartaVira = "scale(0.1, 1)"; elemento.addEventListener("click", function(event){ event.preventDefault(); const clicado = event.target; segundoId = clicado.id const virado = clicado.className; verificaSePodeMostrarCarta(virado, clicado) primeiroId = clicado.id; }); function animaACartaVirando(carta){ carta.animate({"transform" : escalaEnquantoCartaVira}, tempoParaVirarACarta); setTimeout(() => { trocaClasseVerso(carta); carta.style.transform = escalaEnquantoCartaVira; carta.animate({"transform" : escalaInteira}, tempoParaVirarACarta); setTimeout(() => { carta.style.transform = escalaInteira; }, tempoParaVirarACarta); }, (tempoParaVirarACarta - 30)); } function colocaModalVitoria(elemParaModal){ elemParaModal.classList.remove("escondeModal"); } function colocaNoVetorDeVerificacao(clicado){ //Para fazer a verificação(comparação), coloquei em um vetor... const classeElementoClicado = clicado.className; elementosClicados.push(classeElementoClicado); } function defineNumeroDePares(){ const numeroDeCartas = elemento.childNodes.length - 2; const numeroDosPares = numeroDeCartas / 2; return numeroDosPares; } function desviraCarta(){ const primeiro = document.getElementById(primeiroId); const segundo = document.getElementById(segundoId); setTimeout(() => { animaACartaVirando(primeiro); tocarSomDesvirando(); animaACartaVirando(segundo); }, tempoAntesDaCartaErradaVirarDeVolta); } function fazValidacoes(cartasClicadasPorRodada, clicado){ if (verificaSeUmaDuplaJaFoiClicada(cartasClicadasPorRodada)){ verificaDupla(elementosClicados, clicado); verificaVitoria(numeroDePares); } } function invalidaCliques(){ telaNaoClicavel.classList.add("naoClicavel"); } function seCartaEstaViradaParaBaixo(virado){ if (virado.indexOf('verso') !== -1){ return true; }else{ return false; } } function tocarSomDeAcerto(){ var audioAcertou = new Audio(); audioAcertou.src = "success.wav"; audioAcertou.play(); } function tocarSomDesvirando(){ var audio2 = new Audio(); audio2.src = "desviraCartaSom.wav"; audio2.play(); } function tocarSomVirando(){ var audio1 = new Audio(); audio1.src = "viraCartaSom.wav"; audio1.play(); } function tocarSomVitoria(){ var audioVitoria = new Audio(); audioVitoria.src = "vitoria.wav"; audioVitoria.play(); } function trocaClasseVerso(alvo){ alvo.classList.toggle("verso"); } function validaCliques(){ telaNaoClicavel.classList.remove("naoClicavel"); } function verificaDupla(){ //verifica as classes (se for igual, a imagem também será)... if(elementosClicados[0] === elementosClicados[1]){ setTimeout(() => { tocarSomDeAcerto(); }, tempoParaVirarACarta * 3); pontos ++; }else{ invalidaCliques(); setTimeout(() => { validaCliques(); }, tempoNaoClicavel); desviraCarta(); } elementosClicados = []; cartasClicadasPorRodada -= 2; } function verificaSePodeMostrarCarta(virado, clicado){ if (seCartaEstaViradaParaBaixo(virado) && clicado.id){ viraCarta(clicado); colocaNoVetorDeVerificacao(clicado); fazValidacoes(cartasClicadasPorRodada, clicado); cartasClicadasPorRodada ++; } } function verificaSeUmaDuplaJaFoiClicada(cartasClicadasPorRodada){ if (cartasClicadasPorRodada > 0){ return true; } else{ return false; } } function verificaVitoria(numeroDePares){ if(pontos == numeroDePares){ setTimeout(() => { tocarSomVitoria(); colocaModalVitoria(elemParaModal); }, tempoParaAparecerMensagemVitoria); }else{ console.log("Ainda não...") } } function viraCarta(clicado){ animaACartaVirando(clicado); tocarSomVirando(); }
/** * LINKURIOUS CONFIDENTIAL * Copyright Linkurious SAS 2012 - 2018 * * - Created on 2014-12-17. */ 'use strict'; // ext libs const Promise = require('bluebird'); // services const LKE = require('../../../index'); const Utils = LKE.getUtils(); const Data = LKE.getData(); const Access = LKE.getAccess(); const VisualizationDAO = LKE.getVisualizationDAO(); // locals const api = require('../../api'); module.exports = function(app) { // source reconnect /** * @api {post} /api/admin/source/:dataSourceIndex/connect Connect a disconnected data-source * @apiName ReconnectSource * @apiGroup DataSources * @apiVersion 1.0.0 * @apiPermission action:admin.connect * @apiDescription Connect a disconnected data-source * @apiParam {string} dataSourceIndex config-index of a data-source */ app.post('/api/admin/source/:dataSourceIndex/connect', api.respond(req => { return Access.hasAction(req, 'admin.connect').then(() => { // we don't wait for the data-source to connect Data.resolveSource( Utils.tryParsePosInt(req.param('dataSourceIndex'), 'dataSourceIndex') ).connect(true); }); })); // reset sandboxes /** * @api {post} /api/admin/source/:dataSource/resetDefaults Reset settings for new visualizations * @apiName ResetSourceStyles * @apiGroup DataSources * @apiVersion 1.0.0 * @apiPermission action:admin.resetDefaults * @apiDescription Reset design and/or captions of all sandboxes of the given data-source to configuration-file values. * If `design` is true, set the `design.palette` and `design.styles` to current `palette` and `defaultStyles` configuration values. * If `captions` is true, set `nodeFields.captions` and `edgeFields.captions` to current `defaultCaptions.nodes` and `defaultCaptions.edges` configuration values. * * @apiParam {string} dataSource Key of a data-source * @apiParam {boolean} design Whether to reset default design to configuration-file values. * @apiParam {boolean} captions Whether to reset default captions to configuration-file values. */ app.post('/api/admin/source/:dataSource/resetDefaults', api.respond(req => { return Access.hasAction(req, 'admin.resetDefaults', req.param('dataSource')).then(() => { return VisualizationDAO.resetSandboxes( req.param('dataSource'), { design: Utils.parseBoolean(req.param('design')), captions: Utils.parseBoolean(req.param('captions')) } ); }); }, 204)); // all the other APIs other than connect needs "admin.config" app.all('/api/admin/source*', api.proxy(req => { return Access.hasAction(req, 'admin.config'); })); // source index-mapping /** * @api {get} /api/admin/source/:dataSource/hidden/nodeProperties Get hidden node-properties * @apiName getHiddenNodeProperties * @apiGroup DataSources * @apiVersion 1.0.0 * @apiPermission action:admin.config * @apiDescription Get the list of node-properties hidden for the given data-source. * @apiParam {string} dataSource Key of a dataSource */ app.get('/api/admin/source/:dataSource/hidden/nodeProperties', api.respond(req => { return Promise.resolve(Data.resolveSource(req.param('dataSource')).getHiddenNodeProperties()); })); /** * @api {get} /api/admin/source/:dataSource/hidden/edgeProperties Get hidden edge-properties * @apiName getHiddenEdgeProperties * @apiGroup DataSources * @apiVersion 1.0.0 * @apiPermission action:admin.config * @apiDescription Get the list of edge-properties hidden for the given data-source. * @apiParam {string} dataSource Key of a dataSource */ app.get('/api/admin/source/:dataSource/hidden/edgeProperties', api.respond(req => { return Promise.resolve(Data.resolveSource(req.param('dataSource')).getHiddenEdgeProperties()); })); /** * @api {get} /api/admin/source/:dataSource/noIndex/nodeProperties Get non-indexed node-properties * @apiName getNoIndexNodeProperties * @apiGroup DataSources * @apiVersion 1.0.0 * @apiPermission action:admin.config * @apiDescription Get the list of node-properties that are not indexed for the given data-source. * @apiParam {string} dataSource Key of a dataSource */ app.get('/api/admin/source/:dataSource/noIndex/nodeProperties', api.respond(req => { return Promise.resolve(Data.resolveSource(req.param('dataSource')).getNoIndexNodeProperties()); })); /** * @api {get} /api/admin/source/:dataSource/noIndex/edgeProperties Get non-indexed edge-properties * @apiName getNoIndexEdgeProperties * @apiGroup DataSources * @apiVersion 1.0.0 * @apiPermission action:admin.config * @apiDescription Get the list of edge-properties that re not indexed for the given data-source. * @apiParam {string} dataSource Key of a dataSource */ app.get('/api/admin/source/:dataSource/noIndex/edgeProperties', api.respond(req => { return Promise.resolve(Data.resolveSource(req.param('dataSource')).getNoIndexEdgeProperties()); })); /** * @api {put} /api/admin/source/:dataSource/hidden/nodeProperties Set hidden node-properties * @apiName setHiddenNodeProperties * @apiGroup DataSources * @apiVersion 1.0.0 * @apiPermission action:admin.config * @apiDescription Set the list of node-properties that are hidden for the given data-source. * @apiParam {string} dataSource Key of a dataSource * @apiParam {string[]} properties List of property names */ app.put('/api/admin/source/:dataSource/hidden/nodeProperties', api.respond(req => { return Data.resolveSource(req.param('dataSource')).setHiddenNodeProperties( req.param('properties', []) ); })); /** * @api {put} /api/admin/source/:dataSource/hidden/edgeProperties Set hidden edge-properties * @apiName setHiddenEdgeProperties * @apiGroup DataSources * @apiVersion 1.0.0 * @apiPermission action:admin.config * @apiDescription Set the list of edge-properties that are hidden for the given data-source. * @apiParam {string} dataSource Key of a dataSource * @apiParam {string[]} properties List of property names */ app.put('/api/admin/source/:dataSource/hidden/edgeProperties', api.respond(req => { return Data.resolveSource(req.param('dataSource')).setHiddenEdgeProperties( req.param('properties', []) ); })); /** * @api {put} /api/admin/source/:dataSource/noIndex/nodeProperties Set non-indexed node-properties * @apiName setNoIndexNodeProperties * @apiGroup DataSources * @apiVersion 1.0.0 * @apiPermission action:admin.config * @apiDescription Set the list of node-properties that are not indexed for the given data-source. * @apiParam {string} dataSource Key of a dataSource * @apiParam {string[]} properties List of property names */ app.put('/api/admin/source/:dataSource/noIndex/nodeProperties', api.respond(req => { return Data.resolveSource(req.param('dataSource')).setNoIndexNodeProperties( req.param('properties', []) ); })); /** * @api {put} /api/admin/source/:dataSource/noIndex/edgeProperties Set non-indexed edge-properties * @apiName setNoIndexEdgeProperties * @apiGroup DataSources * @apiVersion 1.0.0 * @apiPermission action:admin.config * @apiDescription Set the list of edge-properties that are not indexed for the given data-source. * @apiParam {string} dataSource Key of a dataSource * @apiParam {string[]} properties List of property names */ app.put('/api/admin/source/:dataSource/noIndex/edgeProperties', api.respond(req => { return Data.resolveSource(req.param('dataSource')).setNoIndexEdgeProperties( req.param('properties', []) ); })); /** * @api {get} /api/admin/sources Get all data-sources information * @apiName getAllSourceInfo * @apiGroup DataSources * @apiVersion 1.0.0 * @apiPermission action:admin.config * @apiDescription Get information for all data-source, including data-sources that do not exist online. * * @apiSuccess {object[]} sources Data-source information. * @apiSuccess {string} sources.lastSeen Last time this data-source was seen online (ISO-8601 date) * @apiSuccess {string} sources.indexedDate Last time this data-source was indexed (ISO-8601 date) * @apiSuccess {string} sources.key Key of the data-source (when is has been connected before, `null` otherwise) * @apiSuccess {string} sources.host Host of the data-source * @apiSuccess {string} sources.port Port of the data-source * @apiSuccess {string} sources.storeId Unique store identifier of the graph database (when it has been connected before, `null` otherwise) * @apiSuccess {string} sources.state State code if the data-source (`"ready"` , `"offline"` ...). * @apiSuccess {number} sources.visualizationCount Number of visualizations that exist for this data-source * @apiSuccess {number} sources.configIndex The index of the data-source's config (if the config still exists, `null` otherwise) */ app.get('/api/admin/sources', api.respond(() => { return Data.getAllSources(); })); /** * @api {post} /api/admin/sources/config Create a new data-source configuration * @apiName createSourceConfig * @apiGroup DataSources * @apiVersion 1.0.0 * @apiPermission action:admin.config * @apiDescription Create a new data-source configuration (contains a graph database configuration and an index configuration). * * @apiParam {string} name Name of the data-source. * @apiParam {object} graphDb The configuration options of the graph database. * @apiParam {string} graphDb.vendor The vendor of the graph database (`"neo4j"`, `"allegroGraph"`...). * @apiParam {object} index The configuration options of the full-text index. * @apiParam {object} index.vendor The vendor of the full-text index (`"elasticSearch"`). * @apiParam {string} index.host Host of the full-text index server. * @apiParam {number} index.port Port of the full-text index server. * @apiParam {boolean} index.forceReindex Whether to re-index this graph database at each start of Linkurious. * @apiParam {boolean} index.dynamicMapping Whether to enable automatic property-types detection for enhanced search. */ app.post('/api/admin/sources/config', api.respond(req => { return Data.createSource({ name: req.param('name'), graphdb: req.param('graphDb') || req.param('graphdb'), index: req.param('index') }); }, 201)); /** * @api {delete} /api/admin/sources/config/:configIndex Delete a data-source configuration * @apiName deleteSourceConfig * @apiGroup DataSources * @apiVersion 1.0.0 * @apiPermission action:admin.config * @apiDescription Delete a data-source configuration that has currently no connected data-source. * * @apiParam {number} configIndex Index of a data-source configuration */ app.delete('/api/admin/sources/config/:configIndex', api.respond(req => { return Data.deleteSourceConfig( Utils.tryParsePosInt(req.param('configIndex'), 'configIndex', false) ); }, 204)); /** * @api {delete} /api/admin/sources/data/:sourceKey Delete all data-source data * @apiName deleteSourceData * @apiGroup DataSources * @apiVersion 1.0.0 * @apiPermission action:admin.config * @apiDescription Delete all data of data-source (visualizations, access rights, widgets, full-text indexes). * Optionally merge visualizations and widgets into another data-source instead of deleting them. * Warning: when merging into another data-source, visualizations may break if node and edge IDs are not the same in to target data-source. * * @apiParam {string} sourceKey Key of a disconnected data-source which data must be deleted. * @apiParam {string} merge_into Key of a data-source to merge visualizations and widgets into. * * @apiSuccess {boolean} migrated True if the affected items have been migrated to another data-source, false if they have been deleted. * @apiSuccess {object} affected Affected object counts. * @apiSuccess {number} affected.visualizations Number of migrated/deleted visualizations (with their widgets). * @apiSuccess {number} affected.folders Number of migrated/deleted visualization folders. * @apiSuccess {number} affected.alerts Number of migrated/deleted alerts. * @apiSuccess {number} affected.matches Number of migrated/deleted matches. */ app.delete('/api/admin/sources/data/:sourceKey', api.respond(req => { const sourceKey = req.param('sourceKey'); Utils.checkSourceKey(sourceKey); const mergeInto = req.param('merge_into'); Utils.checkSourceKey(mergeInto, 'mergeInto', true); return Data.deleteSourceData(sourceKey, mergeInto); }, 200)); };
'use strict'; const React = require('react'); const Link = require('react-router').Link; const NavigationBar = () => ( <nav className='NavigationBar'> <ul className='NavigationBar__list'> <li className='NavigationBar__element'> <Link to='/' className='NavigationBar__link'>Home</Link> </li> <li className='NavigationBar__element'> <Link to='/about' className='NavigationBar__link'>About</Link> </li> <li className='NavigationBar__element'> <Link to='/contact' className='NavigationBar__link'>About</Link> </li> </ul> </nav> ); module.exports = NavigationBar;
var GrepApplication; var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; }; GrepApplication = (function() { function GrepApplication() { GrepApplication.__super__.constructor.apply(this, arguments); } __extends(GrepApplication, Application); GrepApplication.prototype.onOpen = function() { var message; GrepApplication.__super__.onOpen.apply(this, arguments); message = JSON.stringify([ "subscribe", { source: this.getQueryStringVariable("source"), search: this.getQueryStringVariable("search") } ]); console.log("Sending", message); return this.socket.send(message); }; GrepApplication.prototype.onMessage = function(evt) { var message; GrepApplication.__super__.onMessage.call(this, evt); message = JSON.parse(evt.data); switch (_.first(message)) { case "message": return this.addStatus(_.last(message)); default: return console.log("Don't know what to do with", message); } }; GrepApplication.prototype.addStatus = function(payload) { return document.getElementById('output').innerHTML = payload.message + "<br/>\n" + document.getElementById('output').innerHTML; }; return GrepApplication; })();
var sidebar_2commands_8c = [ [ "sb_parse_whitelist", "sidebar_2commands_8c.html#a7d3a4db808135ebb02ebd2b5d2c5713a", null ], [ "sb_parse_unwhitelist", "sidebar_2commands_8c.html#a8f2bb3b173205a5b055df25cbd59d984", null ] ];
const User = require('../models/user'); const Post = require('../models/post'); function usersShow(req, res) { let user; User .findById(req.params.id) .populate('favourites followers following') .exec() .then(userData => { if (!userData) return res.status(404).render('error', { error: 'No user found.'}); user = userData; return Post.find({ user: user._id }).exec(); }) .then(posts => { user.posts = posts; res.render('users/show', { user }); }) .catch(err => { res.status(500).render('error', { error: err }); }); } function addFollower(req, res) { if ( req.params.id !== res.locals.currentUser._id ) { User .findById(req.params.id) .exec() .then(user => { user.followers.push(res.locals.currentUser._id); user.save(); return User.findById(res.locals.currentUser._id).exec(); }) .then(user => { user.following.push(req.params.id); user.save(); res.redirect(`/users/${req.params.id}`); }); } else { res.sendStatus(500); } } function removeFollower(req, res) { if ( req.params.id !== res.locals.currentUser._id ) { User .findByIdAndUpdate({ _id: res.locals.currentUser._id }, { $pull: { 'following': req.params.id } }).exec() .then(() => { return User.findByIdAndUpdate({ _id: req.params.id }, { $pull: { 'followers': res.locals.currentUser._id } }).exec(); }) .then(() => { res.redirect(`/users/${res.locals.currentUser._id}`); }) .catch(err => { console.log(err); }); } else { res.sendStatus(500, { message: 'Following error' }); } } module.exports = { show: usersShow, follow: addFollower, unfollow: removeFollower };
var hand; function janken(hand){ machineHand = Math.floor(Math.random()*3); document.write('<h2>ポン!</h2>'); if(machineHand == 0){ document.write('<img src="./image/gu.jpg" alt="画像の解説文" width="200" height="200"/>'); }else if(machineHand == 1){ document.write('<img src="./image/tyoki.jpg" alt="画像の解説文" width="200" height="200"/>'); }else if(machineHand == 2){ document.write('<img src="./image/pa.jpg" alt="画像の解説文" width="200" height="200"/>'); } document.write("<br>"); var judge; if( (hand-machineHand+3) % 3 == 0 ){ document.write('<h2>両者の引き分け</h2>'); }else if( (hand-machineHand+3) % 3 == 1){ document.write('<h2>あなたの負け</h2>'); }else if( (hand-machineHand+3) % 3 == 2 ){ document.write('<h2>あなたの勝ち</h2>'); } }
var a = [1,2,3]; var b= [3,2,1]; var c = []; a.forEach(function(item){ c.push(item); }); for(var i=0; i<b.length; i++){ c.push(b[i]); } c = a.concat(b);
import http from './httpServices'; import proxy from '../config/proxy.json'; export function httpRegister(username, email, password) { return http.post(proxy.api_register, { username, email, password }); } export function httpLogin(email, password) { return http.post(proxy.api_login, { email, password }); } export function httpRecovery(email) { return http.post(proxy.api_recovery, { email }); } export function httpReset(password, token) { return http.post( proxy.api_reset, { password }, { params: { token, }, } ); }
import verge from 'verge'; import events from 'utils/events'; class Viewport { constructor() { this.width = Viewport.calculateWidth(); this.height = Viewport.calculateHeight(); this.ratio = this.width / this.height; this.bind(); } bind() { this.onResize = this.onResize.bind(this); window.addEventListener('resize', this.onResize); } static calculateWidth() { return verge.viewportW(); } static calculateHeight() { return verge.viewportH(); } onResize() { this.width = Viewport.calculateWidth(); this.height = Viewport.calculateHeight(); this.ratio = this.width / this.height; events.emit(events.RESIZE, this.width, this.height, this.ratio); } } export default new Viewport();
/** * @name CourseList * * @author Mario Arturo Lopez Martinez * @author Chris Holle * * @overview @TODO * * @TODO: Add functionality for edit (link to edit form) */ import React from "react" import { useQuery } from "@apollo/react-hooks" import CourseCard from "components/cards/courseCard" import { Mutation } from "react-apollo" import { COURSE_DELETE_QUERY, COURSE_QUERY } from "data/queries" const SectionStyle = { display: "flex", flexWrap: "wrap", width: "100%", height: "auto", paddingBottom: "3vh", } export default () => { const { loading, error, data } = useQuery(COURSE_QUERY, { pollInterval: 5000, }) return ( <div style={SectionStyle}> {loading && <p>Loading...</p>} {error && <p>Error: ${error.message}</p>} {data && data.courses && data.courses.map(node => ( <div key={node.id}> <Mutation mutation={COURSE_DELETE_QUERY} update={client => { const { courses } = client.readQuery({ query: COURSE_QUERY }) client.writeQuery({ query: COURSE_QUERY, // Filter to only include courses that haven't been deleted data: { courses: courses.filter(course => course.id !== node.id), }, }) }} key={node.id} > {postMutation => !node.archived ? ( <CourseCard name={node.name} number={node.number} semester={node.semester} prefix={node.prefix} year={node.year} id={node.id} startDate={node.startDate} endDate={node.endDate} onChildClick={e => { postMutation({ variables: { id: e } }) }} /> ) : ( "" ) } </Mutation> </div> ))} </div> ) }
import moment from 'moment' const contactsReducer = ( state = { array: [], object: {} }, action ) => { switch( action.type ) { case 'UPDATE_FULFILLED': case 'GETALL_FULFILLED': // action.payload is an array of contacts resulting from a transformed firebase call return action.payload ? action.payload : state break case 'ADDONE_FULFILLED': return state break case 'CLEAR_FULFILLED': return { array: [], object: {} } break default: return state } } export default contactsReducer
import { createClient } from '@supabase/supabase-js' const config = { key: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYyMzMyMTAxOCwiZXhwIjoxOTM4ODk3MDE4fQ.YISggSEzSk6WsMNkvN2a5MHYWBVjQ84nHwWYne9sTA0', url: 'https://tfvnrohsjcgsekfnggks.supabase.co', } const key = import.meta.env['VITE_SUPABASE_ANON_KEY'] || config.key const url = import.meta.env['VITE_SUPABASE_URL'] || config.url const client = createClient(url, key) export const getScores = (limit = 50) => client .from('scores') .select() .limit(limit) .order('time') .then(({ data }) => data) export const insertScore = ({ time, name }) => client .from('scores') .insert({ time, name }) .then(({ data }) => data)
var app = app || {}; app.Food = Backbone.Model.extend({ defaults : { id : 1, text : 'some text' } });
var left_width = 250; var window_width; var window_height; $(document).ready(function(){ window_width = parent.g_width; window_height = parent.g_frameheight; $(".layout").height(window_height - 36); $(".layout-left").height(window_height - 36); $(".layout-center").height(window_height - 36); $(".layout-collapse-left").height(window_height - 36); $(".layout-left").width(left_width); $(".layout-center").css("left", left_width + 8); $(".layout-center").width(window_width - left_width - 22); //控制hover $(".layout-header").mouseover(function(){ $(this).addClass("layout-header-over"); }); $(".layout-header").mouseout(function(){ $(this).removeClass("layout-header-over"); }); $(".layout-header-toggle").mouseover(function(){ $(this).addClass("layout-header-toggle-over"); }); $(".layout-header-toggle").mouseout(function(){ $(this).removeClass("layout-header-toggle-over"); }); $(".layout-collapse-left").mouseover(function(){ $(this).addClass("layout-collapse-left-over"); }); $(".layout-collapse-left").mouseout(function(){ $(this).removeClass("layout-collapse-left-over"); }); $(".layout-collapse-left-toggle").mouseover(function(){ $(this).addClass("layout-collapse-left-toggle-over"); }); $(".layout-collapse-left-toggle").mouseout(function(){ $(this).removeClass("layout-collapse-left-toggle-over"); }); //控制左侧菜单折叠 $(".layout-header-toggle").click(function(){ $(".layout-left").css("display","none"); $(".layout-collapse-left").css("display", "block"); $(".layout-center").css("left", 34); $(".layout-center").width(window_width - 50); }); $(".layout-collapse-left-toggle").click(function(){ $(".layout-left").css("display","block"); $(".layout-collapse-left").css("display", "none"); $(".layout-center").css("left", left_width + 8); $(".layout-center").width(window_width - left_width - 22); }); //为左菜单面板导航添加click事件控制center-page的显隐 $.each($(".accordion-panel ul").children(), function(i, n){ $(n).attr("id", "menu" + i); $(n).bind('click', function(){ //去掉active属性 $(".accordion-panel .menu-active").removeClass("menu-active"); //添加active属性 $(this).addClass("menu-active"); //切换display属性 var index = parseInt($(this).attr("id").slice(4)); //截取menu之后的数字 $(".center-page").css("display", "none"); $("#page" + index).css("display", "block"); }) }) })
/*========================================================== Author : Siva Kella Date Created: 28 Nov 2016 Description : To handle the service for Logout module Change Log s.no date author description ===========================================================*/ logout.service('logoutService', ['$http', '$q', 'Flash', 'apiService', function ($http, $q, Flash, apiService) { var logoutService = {}; return logoutService; }]);
'Use strict' // const refs = { // allLogins: ['Mango', 'robotGoogles', 'Poly', 'Aj4x1sBozz', 'qwerty123'], // isLoginUnique(login) { // if(this.allLogins.includes(login)) { // alert('Login already exists!'); // return false; // }else{ // return true; // } // }, // isLoginValid(login) { // if(login.length>=4 && login.length<=16) { // return true; // }else{ // alert('Length Error!'); // return false; // } // }, // addLogin(login) { // login = prompt('Enter login') // if(this.isLoginValid(login) && this.isLoginUnique(login)) { // this.allLogins.push(login); // alert('Login was successfully added!'); // console.log(this.allLogins); // } // } // } // refs.addLogin(); // let arr = ['a', 'b']; // arr.push(function() { // alert(this) // }); // arr[2](); const obj = { name: "Arthur", age: 19, showInfo: function () { alert(`I am ${this.name}. I am ${this.age}`) } } obj.showInfo();
// define a variable to import the <Verifier> or <renamedVerifier> solidity contract generated by Zokrates let Verifier = artifacts.require('Verifier'); let proof = require('../../zokrates/code/square/proof').proof let input = require('../../zokrates/code/square/proof').input // Test verification with correct proof // - use the contents from proof.json generated from zokrates steps // Test verification with incorrect proof contract('Verifier', accounts => { const owner = accounts[0]; describe("The test cases in 'TestSquareVerifier.js'", function () { beforeEach(async function () { this.contract = await Verifier.new({from: owner}); }) it('Test verification with correct proof', async function () { let result = await this.contract.verifyTx.call( proof.A, proof.A_p, proof.B, proof.B_p, proof.C, proof.C_p, proof.H, proof.K, input, {from: owner}) assert.equal(result, true, 'the verification should be correct') }) it('Test verification with incorrect proof', async function () { let result = await this.contract.verifyTx.call( proof.A, proof.A_p, proof.B, proof.B_p, proof.C, proof.C_p, proof.H, proof.K, [2,4], {from: owner}) assert.equal(result, false, 'the verification should not be correct') }) }); })
import {useEffect} from "react"; import {useRecoilState} from "recoil"; import {pageState} from "~/components/organisms/PageEditor/pageAtoms"; import ComponentRender from "../../pageComponents/ComponentRender"; import {StyledPageRender} from "./PageRender.style"; import {pageRenderState} from "./PageRenderAtom"; const PageRender = function (props) { const [liveMode, setLiveMode] = useRecoilState(pageRenderState); const [page, setPage] = useRecoilState(pageState); useEffect(() => { setLiveMode(props.isLive); }, [props.isLive]); if (liveMode == null) return <></>; if (!liveMode) return ( <StyledPageRender> <ComponentRender component={page.components} /> </StyledPageRender> ); if (liveMode) return <ComponentRender component={page.components} />; }; export default PageRender;
//$(document).ready(function () { $("input").attr("autocomplete", "off"); }); //$(document).ready(function () { $("textarea").attr("autocomplete", "off"); }); /*Search*/ $(document).ready(function () { $("#nav-search-in-content").text("Library Resources"); $("#searchDropdownBox").change(function () { var Search_Str = $(this).val(); //replace search str in span value $("#nav-search-in-content").text(Search_Str); }); }); //Show / Hide Text $(document).ready(function () { var slideDiv = $(".slidingDiv"); var showMore = $(".show_text"); var hideMore = $(".hide_text"); /*Show Text*/ $(".show_text").click(function (e) { e.preventDefault(); if (slideDiv.hasClass("hide")) { //showMore.html("> show less"); showMore.addClass('hide'); //slideDiv.slideUp(0,function(){ // slideDiv.removeClass('hide') // slideDiv.addClass('show_div') // .slideDown('fast'); // }); slideDiv.removeClass('hide'); slideDiv.addClass('show_div'); } }); /*Hide Text*/ $(".hide_text").click(function (e) { e.preventDefault(); if (slideDiv.hasClass("show_div")) { //showMore.html("> show less"); showMore.removeClass('hide'); // slideDiv.slideDown(0,function(){ slideDiv.removeClass('show_div') slideDiv.addClass('hide') // .slideUp('slow'); // }); } }); }); //Show / Hide Description Text $(document).ready(function () { $(".show_desc_info_content").addClass("hide"); //Show/Hide Links $(".show_desc_info").click(function (e) { e.preventDefault(); var $this = $(this); //capture clicked link var show_desc_info_content = $this.parent().find(".show_desc_info_content"); //get the div parent of the clicked .show_hide link if (show_desc_info_content.hasClass("hide")) { $this.html("> hide information"); // show_desc_info_content.slideUp(0,function(){ show_desc_info_content.removeClass('hide') // .slideDown('fast'); // }); } else { $this.html("show information >"); // show_desc_info_content.slideUp('fast',function(){ show_desc_info_content.addClass('hide') // .slideDown(0); // }); } }); var show_desc_info_content = $('.show_desc_info_content'); $('.show_all_desc').click(function (e) { e.preventDefault(); $('.show_desc_info').html("> hide information"); //show_desc_info_content.slideUp(0,function(){ show_desc_info_content.removeClass('hide') // .slideDown('fast'); //}); }); $('.hide_all_desc').click(function (e) { e.preventDefault(); $('.show_desc_info').html("show information >"); //show_desc_info_content.slideUp(0,function(){ show_desc_info_content.addClass('hide') // .slideDown('fast'); // }); }); }); //Show / Hide database tables $(document).ready(function () { var alpha_id = $('#pager-alpha .nav a'); alpha_id.click(function (e) { e.preventDefault(); $('.page').removeClass('hide'); if (this.id == "all") { $('.show_desc_info_content').addClass('hide'); $('.show_desc_info').html("show information >"); } else { $('.page').not('.database-' + this.id).addClass('hide'); $('.show_desc_info_content').removeClass('hide'); $('.show_desc_info').html("> hide information"); } }); }); //Show / Hide Login Information $(document).ready(function () { $(".login_info").addClass('hide'); $('.login_text').click(function (e) { e.preventDefault(); $('.login_text').removeClass('login_selected'); $(".login_info").addClass('hide'); $(".login_info").removeClass('show_login_info'); $(this).next('.login_info').addClass('show_login_info'); $(this).next('.login_info').removeClass('hide'); $(this).addClass('login_selected'); }); }); //Show / Hide - FAQs All Answers $(document).ready(function () { $('.show_all_faq').click(function () { $('div.accordion a.icon').addClass('on'); $('div.accordion div').addClass('show'); }); $('.hide_all_faq').click(function () { $('div.accordion a.icon').removeClass('on'); $('div.accordion div').removeClass('show'); }); }); //*****************************/ //* ALPHA PAGER SCRIPT */ //*****************************/ $(document).ready(function () { var $alphaPager = $("#pager-alpha"), $alphaPagerNav = $(".nav", $alphaPager), $alphaPagerPages = $(".page", $alphaPager), $pageAnchor = window.location.hash; $("a[name]", $alphaPager).each(function () { $(this).attr("id", $(this).attr("name")); }); if ($pageAnchor) { var $elemID = $($pageAnchor), $elemContainer = $elemID.closest("div.page"), $elemIndex = $elemContainer.index() - 1; $elemContainer.show(); $("a", $alphaPagerNav).eq($elemIndex).addClass("active"); } $("a", $alphaPagerNav).on("click", function (e) { e.preventDefault(); var alphaID = $(this).attr("href").replace("#", ""); $("a", $alphaPagerNav).removeAttr("class"); $alphaPagerPages.hide(); $(this).addClass("active"); $(".page:eq(" + alphaID + ")", $alphaPager).show(); $(".page:visible a:first", $alphaPager).focus(); }) }); //Database Table Accordion $(function () { //New function Toggle Attribute //https://gist.github.com/mathiasbynens/298591 $.fn.toggleAttr = function (attr, attr1, attr2) { return this.each(function () { var self = $(this); if (self.attr(attr) == attr1) self.attr(attr, attr2); else self.attr(attr, attr1); }); }; var $database = $('.database-table'); $database.find("thead tr").show(); $database.find("tbody").show(); $database.find("thead").click(function () { $(this).siblings().toggleClass('hide'); $(this).find("th").toggleClass('table_hide'); }) $database.find("thead").bind("keydown", function (e) { if (e.keyCode == 13) { e.stopPropagation(), e.preventDefault(); $(this).siblings().toggleClass('hide'); $(this).find("th").toggleClass('table_hide'); $(this).siblings().find("tr td a").toggleAttr('tabindex', '-1', '0'); }; }); }); //Favorite - Add and Remove to My Resources //Script is needed & used on all pages with a favorite folder $(document).ready(function () { //Get resource name and populate inline for accessibility $(".favorite-id").each(function (index) { var favorite_id = $(this).text(); $(".favorite-id-title").each(function (i) { if (index == i) { $(this).html(favorite_id); } }); }); //Add and Remove favorites to and from My Resources var favorite = $('.favorite'); //By Keyboard /** favorite.bind("keydown", function (e) { if (e.keyCode == 13) { e.stopPropagation(), e.preventDefault(); $(this).toggleClass('favorite_on'); var favorite_id = $(this).find('.favorite-id-title').text(); if ($(this).hasClass('favorite_on')) { $(this).attr('title', 'Remove ' + favorite_id + ' from My Resources'); } else { $(this).attr('title', 'Add ' + favorite_id + ' to My Resources'); }; }; if (e.keyCode == 27) { //return if ESC is pressed }; }); **/ //By Click // favorite.click(function(e){ // e.stopPropagation(), e.preventDefault(); // $(this).toggleClass('favorite_on'); // // var favorite_id = $(this).find('.favorite-id-title').text(); // // if ($(this).hasClass('favorite_on')){ // $(this).attr('title', 'Remove ' + favorite_id + ' from My Resources'); // } else{ // $(this).attr('title', 'Add ' + favorite_id + ' to My Resources'); // }; // }); //Populate Add or Remove inline depending on the state of the favorite $('.favorite').each(function (index) { if ($(this).hasClass('favorite_on')) { $(this).prepend("Remove"); } else { $(this).prepend("Add"); } }); }); //CONTACT form $(function () { $('.contact_option').addClass("hide"); $('#option8').removeClass("hide"); $('.contact_option').find('input,select,textarea,button').attr('tabindex', '-1'); $('#option8').find('input,select,textarea,button').attr('tabindex', '0'); //$('.contact_option').children().attr('tabindex', '-1'); //$('#option8').children().attr('tabindex', '0'); // $('#contact_subject').change(function () { // $('.contact_option').addClass("hide"); // $('#' + $(this).val()).removeClass("hide"); // $('.contact_option').find('input,select,textarea,button').attr('tabindex', '-1'); // $('#' + $(this).val()).find('input,select,textarea,button').attr('tabindex', '0'); // }); $('#contact_subject').change(function () { location.href = "/about/contact.aspx?formID=" + $(this).val() ; //var url = "/Templates/contactAjax.aspx?formID=" + $(this).val() + "&mathRandom=" + Math.random(); //$(document).ajaxStart(function () { // $("#loading").show(); // $("#ajaxContact").hide(); //}); //$(document).ajaxStop(function () { // $("#loading").hide(); // $("#ajaxContact").show(); //}); //$.get(url, function (data) { // $('.aspNetHidden', this).remove(); // $("#ajaxContact").html(data); // $("#loading").hide(); //}); }); $("#loading").hide(); }); ///////////////// Onclick for contact forms function getInformation() { //btn - get - information userPIN = $("#IndividualsPIN").val(); userEmail = $("#IndividualEmail").val(); if (userPIN != "" || userEmail != "") { var url = "/Templates/getInformation.aspx?action=find&pin=" + userPIN + "&email=" + userEmail + "&mathRandom=" + Math.random(); ; // var aa = '#addFavDiv' + resourceID; // var bb = '#removeFavDiv' + resourceID; // $(aa).hide(); // $(bb).show(); $.get(url, function (data) { $("#getInfo").html(data); $('.aspNetHidden', this).remove(); }); } else { alert('Please enter either a PIN or Email'); } } function hideAlert() { $("#alertPaneldiv").hide(); var url = "/Templates/hideAlert.aspx?mathRandom=" + Math.random(); $.get(url, function (data) { // $("#myResourcesCount").html(data); }); } function addToFavorite(resourceID, resourceTypeID, collection , Title , Url , Date , Author) { var url = "/Templates/resourceAjax.aspx?action=add&rid=" + resourceID + "&rstid=" + resourceTypeID + "&collection=" + collection + "&Url=" + Url + "&Date=" + Date + "&Author=" + Author + "&Title=" + Title + "&mathRandom=" + Math.random(); var aa = '#addFavDiv' + resourceID; var bb = '#removeFavDiv' + resourceID; $(aa).hide(); $(bb).show(); $.get(url, function (data) { $("#myResourcesCount").html(data); document.getElementById('MyResourceslink').title = 'My Resources(' + data +')'; }); } function deleteFavorite(resourceID, resourceTypeID, collection) { var url = "/Templates/resourceAjax.aspx?action=delete&rid=" + resourceID + "&rstid=" + resourceTypeID + "&collection=" + collection + "&mathRandom=" + Math.random(); var aa = '#addFavDiv' + resourceID; var bb = '#removeFavDiv' + resourceID; $(aa).show(); $(bb).hide(); $.get(url, function (data) { $("#myResourcesCount").html(data); }); } function addToFavoriteKP(e , resourceID, resourceTypeID, collection, Title, Url, Date, Author) { var code = (e.keyCode ? e.keyCode : e.which); // alert(code); if (code == 13) { var url = "/Templates/resourceAjax.aspx?action=add&rid=" + resourceID + "&rstid=" + resourceTypeID + "&collection=" + collection + "&Url=" + Url + "&Date=" + Date + "&Author=" + Author + "&Title=" + Title + "&mathRandom=" + Math.random(); var aa = '#addFavDiv' + resourceID; var bb = '#removeFavDiv' + resourceID; $(aa).hide(); $(bb).show(); $.get(url, function (data) { $("#myResourcesCount").html(data); }); } } function deleteFavoriteKP(e ,resourceID, resourceTypeID, collection) { var code = (e.keyCode ? e.keyCode : e.which); //alert(code); if (code == 13) { var url = "/Templates/resourceAjax.aspx?action=delete&rid=" + resourceID + "&rstid=" + resourceTypeID + "&collection=" + collection + "&mathRandom=" + Math.random(); var aa = '#addFavDiv' + resourceID; var bb = '#removeFavDiv' + resourceID; $(aa).show(); $(bb).hide(); $.get(url, function (data) { $("#myResourcesCount").html(data); }); } } //var url = "/Templates/resourceAjax.aspx"; //$.get(url, function (data) { // $("#myResourcesCount").html(data); //}); /////////////////////////////////////// Search stuff /////////////////////////////////////////////////////////////// /**$(document).ready(function () { $('#q').click(function () { var searchTerm = $('#q').val(); if (searchTerm != "") { //alert(searchTerm); } if( ! $( event.target).is('input') ) { alert('background was clicked') } }); }); **/ function gotoSearch2(e) { var code = (e.keyCode ? e.keyCode : e.which); //alert(code); if (code == 13) { var searchTerm = document.getElementById('site_search_field').value; if (searchTerm != "") { location.href = "/sitesearch.aspx?s=" + searchTerm; } return false; } } function gotoSearch() { var searchTerm = document.getElementById('site_search_field').value; if (searchTerm != "") { location.href = "/sitesearch.aspx?s=" + searchTerm; } } ////SSA Reports resources/ssareportsarchive.aspx function gotoSSAReportsSearch2(e) { var code = (e.keyCode ? e.keyCode : e.which); //alert(code); if (code == 13) { var searchTerm = document.getElementById('site_ssareportsearch_field').value; if (searchTerm != "") { location.href = "/resources/ssareportsarchive.aspx?show=simple&s=" + searchTerm; } return false; } } function gotoSSAReportsSearch() { var searchTerm = document.getElementById('site_ssareportsearch_field').value; if (searchTerm != "") { location.href = "/resources/ssareportsarchive.aspx?show=simple&s=" + searchTerm; } } $(document).on('keyup keydown', '#searchDropdownBox', function (e) { var code = (e.keyCode ? e.keyCode : e.which); if (code == 13) { var searchTerm = document.getElementById('q').value; var where = document.getElementById('searchDropdownBox').value; searchAndGoto(where , searchTerm); } }); function gotoTopSearch(e) { var code = (e.keyCode ? e.keyCode : e.which); // alert(code); if (code == 13) { var searchTerm = document.getElementById('q').value; var where = document.getElementById('searchDropdownBox').value; searchAndGoto(where , searchTerm); return false; } } function searchAndGoto(where , searchTerm){ if (searchTerm != "") { if (where == "This Site") { location.href = "/sitesearch.aspx?s=" + searchTerm; } if (where == "SSA Reports") { location.href = "/resources/ssareportsarchive.aspx?show=simple&s=" + searchTerm; } if (where == "Library Resources") { location.href = "/searchsummon.aspx?show=simple&s=" + searchTerm; } } } function summonSearch(e) { var code = (e.keyCode ? e.keyCode : e.which); // alert(code); if (code == 13) { var searchTerm = document.getElementById('home_search').value; if (searchTerm != "") { location.href = "/searchsummon.aspx?s=" + searchTerm; } return false; } } function summonSearch2(e) { var searchTerm = document.getElementById('home_search').value; if (searchTerm != "") { location.href = "/searchsummon.aspx?s=" + searchTerm; } return false; } function summonSearchList(e) { var code = (e.keyCode ? e.keyCode : e.which); // alert(code); if (code == 13) { var searchTerm = document.getElementById('home_search').value; if (searchTerm != "") { location.href = "/searchsummonlist.aspx?s=" + searchTerm; } return false; } } function summonSearchList2(e) { var searchTerm = document.getElementById('home_search').value; if (searchTerm != "") { location.href = "/searchsummonlist.aspx?s=" + searchTerm; } return false; } /////////////////////////////////////// End Search stuff /////////////////////////////////////////////////////////////// /////////////////////////////////////// External Link stuff /////////////////////////////////////////////////////////////// /*** $(document).ready(function () { var currentDomain = document.location.protocol + '//' + document.location.hostname; $('a[href^="http"]:not([href*="' + currentDomain + '"])').on('click', function (e) { e.preventDefault(); // track GA event for outbound links // if (typeof _gaq == "undefined") // return; var link = $(this).attr('href'); if(link.indexOf("ssa.gov") > -1) { location.href = link; } else { $('.dialog').css('visibility', 'visible'); $('.dialog').css('opacity', '1'); $('.overlay').fadeTo("slow", 0.7); $('.overlay').show(); $('#btn-ok').click(function () { window.open(link); $('.overlay').hide(); $('.dialog').css('visibility', 'hidden'); $('.dialog').css('opacity', '0'); }); $('#btn-cancel').click(function () { $('.dialog').css('visibility', 'hidden'); $('.dialog').css('opacity', '0'); $('.overlay').fadeTo("slow", 0); // $('.overlay').hide(); }); $('.overlay').click(function () { $('.overlay').hide(); $('.dialog').css('visibility', 'hidden'); $('.dialog').css('opacity', '0'); }); } //_gaq.push(["_trackEvent", "outbound", this.href, document.location.pathname + document.location.search]); }); }); ***/ /////////////////////////////////////// End External Link stuff /////////////////////////////////////////////////////////////// /////////////////////////////////////// Link Tracking Stuff /////////////////////////////////////////////////////////////// $(document).ready(function () { $('.outboundResource').click(function () { var link = $(this).attr('href'); var resourceid = $(this).attr('resourceid'); // alert(resourceid); var url = "/Templates/Ajax/clicktracks.aspx?rid=" + resourceid + "&link=" + link + "&mathRandom=" + Math.random(); $.get(url, function (data) { // $("#myResourcesCount").html(data); cache: false }); return; }); $('a').click(function () { if (!$(this).hasClass("outboundResource")) { var link = $(this).attr('href'); var url = "/Templates/Ajax/clicktracks.aspx?link=" + link + "&mathRandom=" + Math.random(); if (link != "" || link != "#") { $.get(url, function (data) { // $("#myResourcesCount").html(data); cache: false }); } } }); }); /////////////////////////////////////// Link Tracking Stuff ///////////////////////////////////////////////////////////////
import test from "tape" import { page } from ".." test("page", t => { t.deepEqual( page()([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "Page with default" ) t.deepEqual( page({ offset: 1, limit: 5 })([1, 2, 3, 4, 5, 6, 7, 8]), [2, 3, 4, 5, 6], "5 length page starting from position 1" ) t.deepEqual( page({ offset: 0, limit: 5 })([1, 2, 3]), [1, 2, 3], "limit over source lenght" ) t.deepEqual( page({ offset: 11, limit: 5 })([1, 2, 3]), [], "offset over source lenght" ) t.end() })
import React, {useEffect, useCallback} from 'react'; import PropTypes from 'prop-types'; import {useParams} from 'react-router-dom'; import {connect} from 'react-redux'; import {projectFetcher} from './lib/fetchers'; import {projects} from './lib/redux-modules'; import Debug from './debug.jsx'; const {actions, selector} = projects; const StudioProjects = ({ items, error, loading, moreToLoad, onLoadMore }) => { const {studioId} = useParams(); useEffect(() => { if (studioId && items.length === 0) onLoadMore(studioId, 0); }, [studioId]); const handleLoadMore = useCallback(() => onLoadMore(studioId, items.length), [studioId, items.length]); return ( <div> <h2>Projects</h2> {error && <Debug label="Error" data={error} />} <div> {items.map((item, index) => (<Debug label="Project" data={item} key={index} />) )} {loading ? <small>Loading...</small> : ( moreToLoad ? <button onClick={handleLoadMore}> Load more </button> : <small>No more to load</small> )} </div> </div> ); }; StudioProjects.propTypes = { items: PropTypes.array, // eslint-disable-line react/forbid-prop-types loading: PropTypes.bool, error: PropTypes.object, // eslint-disable-line react/forbid-prop-types moreToLoad: PropTypes.bool, onLoadMore: PropTypes.func }; const mapStateToProps = state => selector(state); const mapDispatchToProps = dispatch => ({ onLoadMore: (studioId, offset) => dispatch( actions.loadMore(projectFetcher.bind(null, studioId, offset)) ) }); export default connect(mapStateToProps, mapDispatchToProps)(StudioProjects);
import {constants} from '../actions/leftMenu'; export default (state = {visible: false}, action) => { switch (action.type) { case constants.OPEN_LEFT_MENU: return {visible: true}; case constants.CLOSE_LEFT_MENU: return {visible: false}; default: return state; } }
$(".bannerbox").slide({ titCell: ".yuandian li", mainCell: ".bd", autoPlay: 'true', depayTime: 2500, effect: 'leftLoop' }); $(".project").slide({ mainCell: ".item", effect: "leftLoop", interTime:2500, vis:4, autoPlay: 'true', });
import React , {Component} from 'react'; import Toolbar from '../../components/Toolbar/Toolbar' import classes from './ProductDisplay.module.css' import ProductBox from '../../components/ProductBox/ProductBox' class ProductDisplay extends Component { render(){ return ( <div className={classes.ProductDisplay}> <Toolbar/> <ProductBox/> </div> ) } } export default ProductDisplay;
const http = require('http'); var fs = require('fs'); const hostname = '127.0.0.1'; const port = 3000; var ur; var met; var s; const server = http.createServer((req, res) => { ur=req.url; console.log(ur); met=req.method; console.log(met); if(req.method=='POST') { let data=' '; req.on('data',(chunk) =>{ s=chunk.toString(); console.log(s); fs.appendFile('hello.txt',ur+" "+met+" "+s, function (err) { if (err) throw err; }); // if(req.method=='DELETE') // fs.appendFile('hello.txt',met+" ", function (err) // { // if (err) throw err; // }); // fs.appendFile('hello.txt',s+" ", function (err) // { // if (err) throw err; // }); }); } res.statusCode = 200; res.setHeader('Content-Type', 'text/plain'); res.end('Hello-World \n'); }); server.listen(port, hostname, () => { console.log(`Server running at http://${hostname}:${port}/`); });
const { baseResolver } = require('../../../libaries/apollo-resolver-creator') const isAdmin = require('../../../libaries/role-checker') const REGISTER_MESSAGE = 'Registered in system.' const UPDATE_TO_IDLE_MESSAGE = `Change status to "IDLE"` const UPDATE_TO_EXPIRE_MESSAGE = `Change status to "EXPIRE"` const ASSIGN_TO_STORE_MESSAGE = 'Assign to ' const IDLE_TYPE = 'IDLE' const ASSIGN_TYPE = 'ASSIGN' const EXPIRE_TYPE = 'EXPIRE' const createBeacon = baseResolver.createResolver( async (root, args, context) => { if (!context.user) { throw new Error('Authentication is required.') } if (!isAdmin(context.user)) { throw new Error('Permission Denied.') } const beacon = await context.models.beacon.create(args) await context.models.beaconHistory.create({ beaconId: beacon._id, title: REGISTER_MESSAGE, type: IDLE_TYPE, }) } ) const assignBeaconToStore = baseResolver.createResolver( async (root, args, context) => { if (!context.user) { throw new Error('Authentication is required.') } if (!isAdmin(context.user)) { throw new Error('Permission Denied.') } args.status = 'INUSE' const beacon = await context.models.beacon.update(args) const storeBranch = await context.models.storeBranch.getOne({ _id: args.assignId, }) const store = await context.models.store.getOne({ _id: storeBranch.storeId, }) await context.models.beaconHistory.create({ beaconId: args._id, title: `${ASSIGN_TO_STORE_MESSAGE}"${store.name}:${storeBranch.name}"`, type: ASSIGN_TYPE, }) return beacon } ) const assignBeaconToProduct = baseResolver.createResolver( async (root, args, context) => { if (!context.user) { throw new Error('Authentication is required.') } if (!isAdmin(context.user)) { throw new Error('Permission Denied.') } args.status = 'INUSE' const beacon = await context.models.beacon.update(args) const product = await context.models.product.getOne({ _id: args.assignId }) await context.models.beaconHistory.create({ beaconId: args._id, title: `${ASSIGN_TO_STORE_MESSAGE}"${product.name}"`, }) return beacon } ) const updateBeacon = baseResolver.createResolver( async (root, args, context) => { if (!context.user) { throw new Error('Authentication is required.') } if (!isAdmin(context.user)) { throw new Error('Permission Denied.') } const beacon = await context.models.beacon.update(args) if (args.status) { let title = UPDATE_TO_IDLE_MESSAGE let type = IDLE_TYPE if (args.status === 'EXPIRE') { title = UPDATE_TO_EXPIRE_MESSAGE type = EXPIRE_TYPE } await context.models.beaconHistory.create({ beaconId: beacon._id, title, type, }) } return beacon } ) const createBeaconTicket = baseResolver.createResolver( async (root, args, context) => { return context.models.beaconRequestTickets.create(args) } ) const updateBeaconTicket = baseResolver.createResolver( async (root, args, context) => { return context.models.beaconRequestTickets.update(args) } ) module.exports = { Mutation: { createBeacon, assignBeaconToStore, assignBeaconToProduct, updateBeacon, createBeaconTicket, updateBeaconTicket, }, }
import { CREATE_OPERATION, DELETE_ALL_OPERATIONS } from '../actions/actiontypes' const operationLogs = (state = [], action) => { switch(action.type) { case CREATE_OPERATION: const operationLog = { log: action.log, time: action.time } return [operationLog, ...state] case DELETE_ALL_OPERATIONS: return [] default: return state } } export default operationLogs
const mongoose = require('mongoose'); var SettingsSchema = new mongoose.Schema({ lang: { type: String, default: 'ru-RU' }, theme: { type: String, default: 'dark' }, storage: { video: { type: String, default: '3' } }, nat: { enable: { type: Boolean, default: 'false' }, externalIP: { type: String }, externalPort: { type: String }, internalPort: { type: String } }, upnp: { enable: { type: Boolean, default: 'false' }, deviceName: { type: String, default: 'eVision' }, iface: { type: String } } }); module.exports = mongoose.model('Settings', SettingsSchema);
import SvgIcon from "../vue/components/SvgIcon.js" import svg_icon from "./index_icon.js" document.getElementById("svg-icon").innerHTML = svg_icon SvgIcon() Vue.component('status-item',{ name: 'status-item', template: '<div class="status-item"> \ <div class="con"> \ <div class="percent-circle percent-circle-left" :style="\'background:\'+color"> \ <div class="left-content" :style="\'transform:rotate(\'+LeftAngle+\'deg)\'"></div> \ </div> \ <div class="percent-circle percent-circle-right" :style="\'background:\'+color"> \ <div class="right-content" :style="\'transform:rotate(\'+RightAngle+\'deg)\'"></div> \ </div> \ <div class="text-circle" style="line-height:var(--name-line-height)">{{value}}%<br>{{name}}</div> \ </div> \ </div>', props: { name: { type: String, default: '' }, value: { type: Number, default: 0 }, color: { type: String, default: '' } }, computed: { RightAngle() { return(this.value>50?"180":Math.round(this.value/5*18).toString()) }, LeftAngle() { return(this.value<50?"0":Math.round((this.value-50)/5*18).toString()) } } }) Vue.component('function-item',{ name: 'function-item', template: '<a :href="url"><div :class="icon==\'usercenter\'?\'function-item2\':\'function-item\'"> \ <div v-if="icon==\'usercenter\'" class="item-ico"> \ <svg-icon :icon-class="icon"/> \ </div> \ <div v-else class="item-icon">{{value}}</div> \ <div>{{name}}</div> \ </div></a>', props: { name: { type: String, default: '' }, icon: { type: String, default: '' }, value: { type: String, default: '' }, url: { type: String, default: '' } } }) var vm = new Vue({ el: "#user-nav", data() { return { status_list: [{ name: "学习进度", value: 0, color: "#FF6F61" }, { name: "练习进度", value: 0, color: "#0F4C81" }], function_list: [{ name: "学习", icon: "learn", function: [{ name: "学习时长", icon: "time", value: '0h', url: '/user#learn' }] },{ name: "讨论", icon: "discuss", function: [{ name: "发起讨论", icon: "asking", value: '0', url: '/user#discussion' },{ name: "参与讨论", icon: "discussion", value: '0', url: '/user#discussion' },{ name: "获得点赞", icon: "like", value: '0', url: '/user#discussion' }] },{ name: "练习", icon: "practice", function: [{ name: "练习数量", icon: "exercise", value: '0', url: '/user#exercise' },{ name: "代码总量", icon: "code", value: '0L', url: '/user#exercise' },{ name: "通过率", icon: "ac", value: '0', url: '/user#exercise' }] },{ name: "用户", icon: "user", function: [{ name: "用户中心", icon: "usercenter", url: '/user' }] }] } } })
import { readFileSync, writeFileSync } from 'fs' import { rebuild } from './gcode.js' const gcodeFile = process.argv[2] console.log('processing', gcodeFile) const gcode = readFileSync(gcodeFile, { encoding: 'utf-8' }) || '' const outputCode = rebuild(gcode, { g1FeedRate: 100, scale: 0.001 }) writeFileSync(gcodeFile + '.gcode', outputCode)
'use strict'; const Module = require('../../../utils/Module'); class ChatEmotes extends Module { constructor(BetterTwitchApp) { super('chat.emotes'); this.BetterTwitchApp = BetterTwitchApp; this.init(); } init() { let self = this; this.BetterTwitchApp.on('BetterTwitchApp:Channel', (channel) => { this.getLogger().info(`Rendering BetterTwitchApp for channel '${channel}'...`); this.BetterTwitchApp.BetterTTV.getEmotes(channel).then((emotes) => { this.bttvEmotes = emotes; }); this.BetterTwitchApp.FrankerFaceZ.getEmotes(channel).then((emotes) => { this.ffzEmotes = emotes; }); this.__renderer = Rx.Observable.interval(25) .switchMap(() => $('.chat-list__lines > .simplebar-scroll-content > .simplebar-content').find('[role="log"]').children().not('[data-bta-parsed="true"]')) .map(r => $(r)) .subscribe((data) => { let emotes = self.bttvEmotes.concat(self.ffzEmotes.concat(self.globalEmotes)); let $messages = data; $messages.each((i) => { let username = $($messages[i]).find('.chat-author__display-name').text(); let $message = $($messages[i]).find('[data-a-target="chat-message-text"]'); if(emotes.length > 0) { $message.each(function (k, elem) { try { elem = $(elem); elem.parent().attr('data-bta-sender', username); elem.html(BetterTwitchApp.Utils.parseMessage(elem.html(), emotes)); } catch (e) { self.getLogger().error(`An error occurred while rendering emotes.`, e); } }); } }); $messages.attr('data-bta-html', $messages.html()); $messages.attr('data-bta-parsed', 'true'); $messages.attr('data-bta-deleted', 'false'); }); }); this.BetterTwitchApp.on('BetterTwitchApp:Whispers', (friend) => { this.getLogger().info(`Rendering BetterTwitchApp for whispers '${friend}'...`); this.__renderer = Rx.Observable.interval(25) .switchMap(() => $('.chat-wrapper > .chat-scroll > .viewport').children().not('[data-bta-parsed="true"]')) .map(r => $(r)) .subscribe((data) => { let emotes = self.bttvEmotes.concat(self.ffzEmotes.concat(self.globalEmotes)); let $messages = data; $messages.each((i) => { let $message = $($messages[i]).find('.message-content').find('span.message'); if(emotes.length > 0) { $message.each(function (k, elem) { try { elem = $(elem); elem.html(BetterTwitchApp.Utils.parseMessage(elem.html(), emotes)); } catch (e) { self.getLogger().error(`An error occurred while rendering emotes.`, e); } }); } }); $messages.attr('data-bta-parsed', 'true'); }); }); this.BetterTwitchApp.on('BetterTwitchApp:Update.PageURL', (page) => { this.bttvEmotes = []; this.ffzEmotes = []; this.globalEmotes = this.BetterTwitchApp.BetterTTV.GlobalEmotes.concat(this.BetterTwitchApp.FrankerFaceZ.GlobalEmotes); if(this.__renderer) { this.__renderer.unsubscribe(); this.__renderer = null; } }); } getLogger() { return this.BetterTwitchApp.getLogger().get('Emotes'); } } module.exports = ChatEmotes;
/** * Copyright 2017 DataChat * www.datachat.ai * All rights reserved */ (function (context, a3) { 'use strict'; if (typeof exports === 'object') { // CommonJS module.exports = a3(require('d3'), require('crossfilter')); } else { if (typeof define === 'function' && define.amd){ // RequireJS | AMD define(['d3'], ['crossfilter'], function (d3, crossfilter) { // publish a3 to the global namespace for backwards compatibility // and define it as an AMD module context.a3 = a3(d3, crossfilter); return context.a3; }); } else { // No AMD, expect d3 to exist in the current context and publish // a3 to the global namespace if (!context.d3 || !context.crossfilter) { if (console && console.warn) { if(!context.d3){ console.warn('a3 requires d3 to run. Are you missing a reference to the d3 library?'); } else if(!context.crossfilter){ console.warn('a3 requires crossfilter to run. Are you missing a reference to crossfilter library?'); } } else { if(!context.d3){ throw 'a3 requires d3 to run. Are you missing a reference to the d3 library?'; } else if(!context.crossfilter){ throw 'a3 requires crossfilter to run. Are you missing a reference to crossfilter library?'; } } } else { context.a3 = a3(context.d3, context.crossfilter); } } } }(this, function (d3, crossfilter) { 'use strict'; // Create a3 object for D3 based distribution chart system. var a3 ={ version: '1.0.0', // Setting up the base of the chart setUp: null, plot: {} }; /* * General function to create distro dimension charts (box plot, notched box plot, violin plot, bean plot) * @param settings Configuration options for the base plot * @param settings.data The data for the plot * @param settings.xName The name of the column that should be used for the x groups * @param settings.yName The name of the column used for the y values * @param {string} settings.selector The selector node for the main chart div *TAKE NOTE THAT NODE IS NOT THE ONLY THING THAT PASS THROUGH SELECTOR IN THE FUTURE, CONSIDER ID AND CLASSES AS WELL AND FUNCTION * @param [settings.axisLabels={}] Defaults to the xName and yName * @param [settings.yTicks = 1] 1 = default ticks, 2 = double, 0.5 = half *TAKE NOTE FOR FUTURE CHANGE * @param [settings.scale = 'linear'] 'linear' or 'log' - y scale of the chart * @param [settings.chartSize = {width:800, height:400}] The height and width of the chart itself (doesn't include the container) * @param [settings.margin = {top: 15, right: 40, bottom: 40, left: 50}] The margins around the chart (inside the main div) * @param [settings.constrainExtremes = false] Should the y scale include outliers? * @param [settings.colors = d3.scaleOrdinal(d3.schemeCategory10)] d3 color options = default, allows customized colors that accept function, array or object * @returns {object} chart A chart object */ a3.plot.makeDistroChart = function(settings) { var chart = { settings: {}, yFormatter: null, yScale: null, xScale: null, data: null, groupObjs:{}, //The data organized by grouping and sorted as well as any metadata for the groups objs: {}, colorFunct: null, margin : {}, svgWidth: null, svgHeight: null, width: null, height: null, xAxisLabel: null, yAxisLabel: null, range: {}, selector: null }; // Defaults chart.settings = { data: null, xName: null, yName: null, selector: null, axisLabels: {xAxis: null, yAxis: null}, // *CURRENTLY DIFFERENT SYNTAX, TAKE NOTE TO ADJUST TICK SIZE IN THE FUTURE yTicks: 1, // *REMEMBER TO ADJUST TICK SIZE FOR XSCALE TOO // xTicks: 1, scale: 'linear', chartSize: {width: 800, height: 400}, margin: {top: 15, right: 40, bottom: 40, left: 50}, constrainExtremes: false, colors: d3.scaleOrdinal(d3.schemeCategory10) }; for (var setting in settings) { chart.settings[setting] = settings[setting]; } chart.data = chart.settings.data; chart.objs = { mainDiv: null, innerDiv: null, chartDiv: null, svg: null, g: null, axes: null, xAxis: null, yAxis: null, tooltip: null }; /* * Adds jitter to the scatter point plot * @param doJitter true or false, add jitter to the point * @param width percent of the range band to cover with the jitter * @returns {number} */ function addJitter(doJitter, width) { if (doJitter !== true || width == 0) { return 0 } return Math.floor(Math.random() * width) - width / 2; } /* * Clone an object as a copy, usually options object pass in as a param * *CONSIDER CLONING ARRAY, OBJECT OF TIME AND TREES IN THE FUTURE, SHOULD ALSO IMPLEMENT ERROR HANDLING * @param {object} obj * @return {object} copy */ function clone(obj) { if (null == obj || 'object' != typeof obj) return obj; var copy = obj.constructor(); for (var attr in obj) { if (obj.hasOwnProperty(attr)) copy[attr] = obj[attr]; } return copy; } /* * Format numbers as float * @param {float} d * @returns {float} float formated number */ function formatAsFloat(d) { if (d % 1 !== 0) { return d3.format('.2f')(d); } else { return d3.format('.0f')(d); } } /* * Accept a function, array or object mapping and create a color function from it * @param {function | [] | object} colorOptions * @returns {function} Function to determine chart color priority */ function getColorFunct(colorOptions) { if(typeof colorOptions == 'function'){ return colorOptions } else if (Array.isArray(colorOptions)){ var colorMap = {}, currentColor = 0; for (var currentName in chart.groupObjs) { colorMap[currentName] = colorOptions[currentColor]; currentColor = (currentColor + 1) % colorOptions.length; } return function (group){ return colorMap[group]; } } else if (typeof colorOptions == 'object') { return function (group) { return colorOptions[group]; } } else { return d3.scaleOrdinal(d3.schemeCategory10); } } /* * Takes a percentage as returns the values that correspond to that percentage of the group range witdh * @param objWidth Percentage of range band * @param gName The bin name to use to get the x shift * @returns {{left: null, right: null, middle: null}} */ function getObjWidth(objWidth, gName) { var objSize = {left: null, right: null, middle: null}; var width = chart.xScale.bandwidth() * (objWidth / 100); var padding = (chart.xScale.bandwidth() - width) / 2; var gShift = chart.xScale(gName); objSize.middle = chart.xScale.bandwidth() / 2 + gShift; objSize.left = padding + gShift; objSize.right = objSize.left + width; return objSize; } /* * Format numbers as log * @param {float} d * @returns {float} log formatted number */ function logFormatNumber(d) { var x = Math.log(d) / Math.log(10) + 1e-6; return Math.abs(x - Math.floor(x)) < 0.6 ? formatAsFloat(d) : ''; } /* * Creates tooltip for Box Charts *CURRENTLY HARD CODED FOR DISTRO CHARTS, TAKE NOTE FOR FUTURE CHANGE * @param groupName Name of x axis group * @param metrics Object to use to show the metrics value of the group * @returns {function} function that provides value for the tooltip */ function tooltipHover (showOutlier, groupName, metrics, toolTipArray) { if(showOutlier === 'metrics'){ var tooltipString = 'Group: ' + groupName; tooltipString += '<br\>Max: ' + formatAsFloat(metrics.max, 0.1); tooltipString += '<br\>Q3: ' + formatAsFloat(metrics.quartile3); tooltipString += '<br\>Median: ' + formatAsFloat(metrics.median); tooltipString += '<br\>Mean: ' + formatAsFloat(metrics.mean); tooltipString += '<br\>Q1: ' + formatAsFloat(metrics.quartile1); tooltipString += '<br\>Min: ' + formatAsFloat(metrics.min); } else { var tooltipString = ''; for(var i =0; i < metrics.length; i++){ tooltipString += '<br\>' + metrics[i] + ': ' + toolTipArray[i]; } } return function() { chart.objs.tooltip.transition().duration(200).style('opacity', 0.9); chart.objs.tooltip.html(tooltipString); }; } /* * Update the chart based on the current settings and window size * @param * @returns {object} The updated chart object */ chart.update = function () { // Update Chart size chart.width = parseInt(chart.objs.chartDiv.style('width'), 10) - (chart.margin.left + chart.margin.right); chart.height = parseInt(chart.objs.chartDiv.style('height'), 10) - (chart.margin.top + chart.margin.bottom); // Update Scale size chart.xScale.range([0, chart.width]); chart.yScale.range([chart.height, 0]); // Update axes chart.objs.g.select('.x.axis') .attr('transform', 'translate(0,' + chart.height + ')') .call(chart.objs.xAxis); chart.objs.g.select('.y.axis') .call(chart.objs.yAxis.tickSizeInner(-chart.width)); chart.objs.g.select('.x.axis .label') .attr('x', chart.width / 2); chart.objs.g.select('.y.axis .label') .attr('x', -chart.height / 2); return chart; }; /* * Parse the data for calculating appropriate base values for all plots * General self-executed group function to group appropriate values in chart.groupObjs settings * Inner function for calculating different plot metrices * @param * @returns */ (function prepareData(){ /* * Calculate Metrics for General Box Plot, Assumes values are sorted * @param [values] Sorted array of numbers * @returns {object} boxMetrics */ function calcBoxMetrics(values){ var boxMetrics = { max: null, upperOuterFence: null, upperInnerFence: null, // 75%-tile of the values quartile3: null, median: null, mean: null, // 25%-tile of the values quartile1: null, // InterQuartile Range iqr: null, lowerInnerFence: null, lowerOuterFence: null, min: null } boxMetrics.max = d3.max(values); boxMetrics.quartile3 = d3.quantile(values, 0.75); boxMetrics.median = d3.median(values); boxMetrics.mean = d3.mean(values); boxMetrics.quartile1 = d3.quantile(values, 0.25); boxMetrics.iqr = boxMetrics.quartile3 - boxMetrics.quartile1; boxMetrics.min = d3.min(values); // Adjust InnerFences to be the closest value to the IQR without going past InnerFence max range var LIF = boxMetrics.quartile1 - (1.5*boxMetrics.iqr); var UIF = boxMetrics.quartile3 + (1.5*boxMetrics.iqr); for(var i = 0; i < values.length; i++){ if(values[i] < LIF){ continue; } if(!boxMetrics.lowerInnerFence && values[i] >= LIF){ boxMetrics.lowerInnerFence = values[i]; continue; } if(values[i] > UIF){ boxMetrics.upperInnerFence = values[i-1]; break; } } // Calculate max range of OuterFences boxMetrics.lowerOuterFence = boxMetrics.quartile1 - (3*boxMetrics.iqr); boxMetrics.upperOuterFence = boxMetrics.quartile3 + (3*boxMetrics.iqr); // If Inner Fences are not declared, none of the values outside of IQR are within InnerFences range // Set the InnerFences to the respective min and max of values if(!boxMetrics.lowerInnerFence) { boxMetrics.lowerInnerFence = boxMetrics.min; } if(!boxMetrics.upperInnerFence) { boxMetrics.upperInnerFence = boxMetrics.max; } return boxMetrics; } // General Grouping function to store grouped values in chart.groupObjs var currentX = null; var currentY = null; var currentRow; for(currentRow = 0; currentRow < chart.data.length; currentRow++){ currentX = chart.data[currentRow][chart.settings.xName]; currentY = chart.data[currentRow][chart.settings.yName]; var tooltipNameArray = Object.keys(chart.data[currentRow]); var toolTipArray = []; for(var i =0; i < tooltipNameArray.length; i++){ var currentToolTip = chart.data[currentRow][tooltipNameArray[i]]; toolTipArray.push(currentToolTip); } if(chart.groupObjs.hasOwnProperty(currentX)){ chart.groupObjs[currentX].values.push(currentY); chart.groupObjs[currentX][currentY] = {}; chart.groupObjs[currentX][currentY].tooltipNameArray = tooltipNameArray; chart.groupObjs[currentX][currentY].toolTipArray = toolTipArray; } else { chart.groupObjs[currentX] = {}; chart.groupObjs[currentX].values = [currentY]; chart.groupObjs[currentX][currentY] = {}; chart.groupObjs[currentX][currentY].tooltipNameArray = tooltipNameArray; chart.groupObjs[currentX][currentY].toolTipArray = toolTipArray; } } for(var currentName in chart.groupObjs){ chart.groupObjs[currentName].values.sort(d3.ascending); chart.groupObjs[currentName].boxMetrics = {}; chart.groupObjs[currentName].boxMetrics = calcBoxMetrics(chart.groupObjs[currentName].values); } //REMEMBER DELETE CONSOLE WHEN FINISH ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ console.log('Chart = '); console.log(chart); //REMEMBER DELETE CONSOLE WHEN FINISH ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ })(); /* * Prepare all the settings for the chart * Set Chart settings based on user settings given * Create Axis Object for the chart using d3 * @param * @returns */ (function prepareSettings(){ // Set chart base settings chart.margin = chart.settings.margin; chart.svgWidth = chart.settings.chartSize.width; chart.svgHeight = chart.settings.chartSize.height; chart.width = chart.settings.chartSize.width - chart.margin.left - chart.margin.right; chart.height = chart.settings.chartSize.height - chart.margin.top - chart.margin.bottom; chart.colorFunct = getColorFunct(chart.settings.colors); if(chart.settings.axisLabels.xAxis || chart.settings.axisLabels.yAxis){ chart.xAxisLabel = chart.settings.axisLabels.xAxis; chart.yAxisLabel = chart.settings.axisLabels.yAxis; } else { chart.xAxisLabel = chart.settings.xName; chart.yAxisLabel = chart.settings.yName; } if (chart.settings.scale === 'log') { chart.yScale = d3.scaleLog(); chart.yFormatter = logFormatNumber; } else { chart.yScale = d3.scaleLinear(); chart.yFormatter = formatAsFloat; } if (chart.settings.constrainExtremes === true) { var fences = []; for (var currentName in chart.groupObjs) { fences.push(chart.groupObjs[currentName].boxMetrics.lowerInnerFence); fences.push(chart.groupObjs[currentName].boxMetrics.upperInnerFence); } chart.range = d3.extent(fences); } else { chart.range = d3.extent(chart.data, function (d) {return d[chart.settings.yName];}); } //REMEMBER DELETE CONSOLE WHEN FINISH ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ console.log('Chart Range = ') console.log(chart.range); //REMEMBER DELETE CONSOLE WHEN FINISH ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Build Scale Functions chart.yScale .range([chart.height, 0]) .domain(chart.range) .nice() .clamp(true); // Default for X Axis Scale is Ordinal, *HARD CODED, TAKE NOTE FOR FUTURE chart.xScale = d3.scaleBand() .domain(Object.keys(chart.groupObjs)) .range([0, chart.width]); // Build Axes Functions chart.objs.yAxis = d3.axisLeft() .scale(chart.yScale) //.tickFormat(chart.yFormatter) .tickSizeOuter(0) .tickSizeInner(-chart.width + (chart.margin.right + chart.margin.left)); // ASSUME DATA TICKS WILL ALWAYS <= 10, FIGURE OUT A WAY TO GET DEFAULT TICK VALUES IN FUTURE chart.objs.yAxis.ticks(10 * chart.settings.yTicks); chart.objs.xAxis = d3.axisBottom() .scale(chart.xScale) .tickSize(5); // *REMEMBER TO ADJUST TICK SIZE FOR XSCALE TOO // .ticks(10 * charrt.settings.xTicks); })(); /* * Prepare Chart Html elements * @param * @returns */ (function prepareChart() { // Build main div and chart div chart.objs.mainDiv = d3.select(chart.settings.selector) .style('max-width', chart.svgWidth + 'px'); // Add divs to make it centered and responsive chart.objs.innerDiv = chart.objs.mainDiv.append('div') .attr('class', 'inner-wrapper'); chart.objs.innerDiv .append('div').attr('class', 'outer-box') .append('div').attr('class', 'inner-box'); // Capture the inner div for the chart (the real container for the chart) chart.selector = chart.objs.innerDiv.select('.inner-box'); chart.objs.chartDiv = chart.selector; d3.select(window).on('resize.chartInnerBox', chart.update); // Create the svg chart.objs.svg = chart.objs.chartDiv.append('svg') .attr('class', 'chart-area') .attr('width', chart.svgWidth) .attr('height', chart.svgHeight); chart.objs.g = chart.objs.svg.append('g') .attr('transform', 'translate(' + (chart.margin.left + 20) + ',' + chart.margin.top + ')'); // Create axes chart.objs.axes = chart.objs.g.append('g') .attr('class', 'axes'); chart.objs.axes.append('g') .attr('class', 'y axis') .call(chart.objs.yAxis) .append('text') .attr('class', 'label') .attr('transform', 'rotate(-90)') .attr('y', -70) .attr('x', -chart.height / 2) .attr('dy', '.71em') .attr('fill', 'black') .style('text-anchor', 'middle') .style('font-weight', 'bold') .text(chart.yAxisLabel.toUpperCase()); chart.objs.axes.append('g') .attr('class', 'x axis') .attr('transform', 'translate(0,' + chart.height + ')') .call(chart.objs.xAxis) .append('text') .attr('class', 'label') .attr('x', chart.width / 2) .attr('y', 35) .attr('dx', '.25em') .attr('fill', 'black') .style('text-anchor', 'middle') .style('font-weight', 'bold') .text(chart.xAxisLabel.toUpperCase()); // Create tooltip div chart.objs.tooltip = chart.objs.mainDiv.append('div').attr('class', 'tooltip'); for(var currentName in chart.groupObjs) { chart.groupObjs[currentName].g = chart.objs.g.append('g') .attr('class', 'group'); /* chart.groupObjs[currentName].g.on('mouseover', function a() { chart.objs.tooltip .style('display', null) .style('left', (d3.event.pageX) + 'px') .style('top', (d3.event.pageY - 28) + 'px'); }) .on('mouseout', function b() { chart.objs.tooltip.style('display', 'none'); }) .on('mousemove', tooltipHover('metrics', currentName, chart.groupObjs[currentName].boxMetrics)); */ } // Update the chart on its size chart.update(); })(); /* * Render a box plot on the current chart * @param options * @param [options.show=true] Toggle the whole plot on and off * @param [options.showBox=true] Show the box part of the box plot * @param [options.showWhiskers=true] Show the whiskers * @param [options.showMedian=true] Show the median line * @param [options.showMean=false] Show the mean line * @param [options.medianCSize=3] The size of the circle on the median * @param [options.showOutliers=true] Show any value that lies more than one and a half times the length of the iqr * @param [options.boxWidth=30] The max percent of the group rangeBand that the box can be * @param [options.lineWidth=boxWidth] The max percent of the group rangeBand that the line can be * @param [options.outlierScatter=false] Spread out the outliers so they don't all overlap (in development) * @param [options.outlierCSize=2] Size of the outliers * @param [options.colors=chart default] The color mapping for the box plot * @returns {*} The chart object */ chart.renderBoxPlot = function (options) { chart.boxPlots = {}; // Default options var defaultOptions = { show: true, showBox: true, showWhiskers: true, showMedian: true, showMean: false, medianCSize: 3.5, meanCSize: 3.5, showOutliers: true, boxWidth: 30, lineWidth: null, scatterOutliers: true, outlierCSize: 2.5, extremeCSize: 2.5, colors: chart.colorFunct }; chart.boxPlots.options = clone(defaultOptions); for (var option in options){ chart.boxPlots.options[option] = options[option]; } var boxOptions = chart.boxPlots.options; // Create Plot Objects for each ticks of xAxis for (var currentName in chart.groupObjs) { chart.groupObjs[currentName].boxPlot = {}; chart.groupObjs[currentName].boxPlot.objs = {}; } /* * Function to calculates all extreme and outlier points for each group * Strore them in group as arrays * Extremes are > 3 times iqr on both ends of the box * Outliers are > 1.5 times iqr on both ends of the box */ var calcAllOutliers = (function() { /* * Create array of extremes and outliers and store the values in current group in place * @param {object} currentGroup of xaxis * @return */ function calcOutliers(currentGroup) { var currentExtremes = []; var currentOutliers = []; var currentOut, index; for(index = 0; index < currentGroup.values.length; index++) { currentOut = {value: currentGroup.values[index], tooltipNameArray: currentGroup[currentGroup.values[index]]["tooltipNameArray"], toolTipArray: currentGroup[currentGroup.values[index]]["toolTipArray"]}; if(currentOut.value < currentGroup.boxMetrics.lowerInnerFence) { if(currentOut.value < currentGroup.boxMetrics.lowerOuterFence) { currentExtremes.push(currentOut); } else { currentOutliers.push(currentOut); } } else if(currentOut.value > currentGroup.boxMetrics.upperInnerFence) { if(currentOut.value > currentGroup.boxMetrics.upperOuterFence) { currentExtremes.push(currentOut); } else { currentOutliers.push(currentOut); } } } currentGroup.boxPlot.objs.outliers = currentOutliers; currentGroup.boxPlot.objs.extremes = currentExtremes; } for (var currentName in chart.groupObjs) { calcOutliers(chart.groupObjs[currentName]); } })(); /* * Take a new set of option and redraw boxPlot * @param {object} updateOptions * @return */ chart.boxPlots.change = function (updateOptions) { if (updateOptions) { for (var option in updateOptions) { boxOptions[option] = updateOptions[option]; } } for (var currentName in chart.groupObjs) { chart.groupObjs[currentName].boxPlot.objs.g.remove(); } chart.boxPlots.prepareBoxPlot(); chart.boxPlots.update(); } /* * Set boxPlot show option to false * @param * @return */ chart.boxPlots.hide = function (opts) { if (opts !== undefined) { opts.show = false; if (opts.reset) { chart.boxPlots.reset() } } else { opts = {show: false}; } chart.boxPlots.change(opts) }; /* * Create svg elements for the box plot * @param * @return */ chart.boxPlots.prepareBoxPlot = function() { var currentName, currentBox; if(boxOptions.colors) { chart.boxPlots.color = getColorFunct(boxOptions.colors); } else { chart.boxPlots.color = chart.colorFunct; } if(boxOptions.show == false) { return; } for(currentName in chart.groupObjs) { currentBox = chart.groupObjs[currentName].boxPlot; currentBox.objs.g = chart.groupObjs[currentName].g.append('g') .attr('class', 'box-plot'); // Box if (boxOptions.showBox) { currentBox.objs.box = currentBox.objs.g.append('rect') .attr('class', 'box') .style('fill', chart.boxPlots.color(currentName)) // Stroke around box is hidden by default but can be shown through css with stroke-width .style('stroke', chart.boxPlots.color(currentName)); } // Median if (boxOptions.showMedian) { currentBox.objs.median = { line: null, circle: null }; currentBox.objs.median.line = currentBox.objs.g.append('line') .attr('class', 'median'); currentBox.objs.median.circle = currentBox.objs.g.append('circle') .attr('class', 'median') .attr('r', boxOptions.medianCSize) .style('fill', chart.boxPlots.color(currentName)); } // Mean if (boxOptions.showMean) { currentBox.objs.mean = { line: null, circle: null }; currentBox.objs.mean.line = currentBox.objs.g.append('line') .attr('class', 'mean'); currentBox.objs.mean.circle = currentBox.objs.g.append('circle') .attr('class', 'mean') .attr('r', boxOptions.meanCSize) .style('fill', chart.boxPlots.color(currentName)); } // Whiskers if (boxOptions.showWhiskers) { currentBox.objs.upperWhisker = { fence: null, line: null }; currentBox.objs.lowerWhisker = { fence: null, line: null }; currentBox.objs.upperWhisker.fence = currentBox.objs.g.append('line') .attr('class', 'upper whisker') .style('stroke', chart.boxPlots.color(currentName)); currentBox.objs.upperWhisker.line = currentBox.objs.g.append('line') .attr('class', 'upper whisker') .style('stroke', chart.boxPlots.color(currentName)); currentBox.objs.lowerWhisker.fence = currentBox.objs.g.append('line') .attr('class', 'lower whisker') .style('stroke', chart.boxPlots.color(currentName)); currentBox.objs.lowerWhisker.line = currentBox.objs.g.append('line') .attr('class', 'lower whisker') .style('stroke', chart.boxPlots.color(currentName)); } // Outliers and Extremes if (boxOptions.showOutliers) { if(!currentBox.objs.outliers) calcAllOutliers(); var currentPoint; if(currentBox.objs.outliers.length) { var outSvg = currentBox.objs.g.append('g').attr('class', 'boxplot outliers'); for(currentPoint in currentBox.objs.outliers) { currentBox.objs.outliers[currentPoint].point = outSvg.append('circle') .attr('class', 'outlier') .attr('r', boxOptions.outlierCSize) .style('fill', chart.boxPlots.color(currentName)); currentBox.objs.outliers[currentPoint].point.on('mouseover', function a() { chart.objs.tooltip .style('display', null) .style('left', (d3.event.pageX) + 'px') .style('top', (d3.event.pageY - 28) + 'px'); }) .on('mouseout', function b() { chart.objs.tooltip.style('display', 'none'); }) .on('mousemove', tooltipHover('outlier', currentName, currentBox.objs.outliers[currentPoint].tooltipNameArray, currentBox.objs.outliers[currentPoint].toolTipArray)); } } if(currentBox.objs.extremes.length) { var extSvg = currentBox.objs.g.append('g').attr('class', 'boxplot extremes'); for(currentPoint in currentBox.objs.extremes) { currentBox.objs.extremes[currentPoint].point = extSvg.append('circle') .attr('class', 'extreme') .attr('r', boxOptions.extremeCSize) .style('stroke', chart.boxPlots.color(currentName)); currentBox.objs.extremes[currentPoint].point.on('mouseover', function a() { chart.objs.tooltip .style('display', null) .style('left', (d3.event.pageX) + 'px') .style('top', (d3.event.pageY - 28) + 'px'); }) .on('mouseout', function b() { chart.objs.tooltip.style('display', 'none'); }) .on('mousemove', tooltipHover('outlier', currentName, currentBox.objs.extremes[currentPoint].tooltipNameArray, currentBox.objs.extremes[currentPoint].toolTipArray)); } } } } } /* * Reset the boxPlot to default option * @param * @return */ chart.boxPlots.reset = function () { chart.boxPlots.change(defaultOptions) }; /* * Set boxPlot show option to true * @param * @return */ chart.boxPlots.show = function (opts) { if (opts !== undefined) { opts.show = true; if (opts.reset) { chart.boxPlots.reset() } } else { opts = {show: true}; } chart.boxPlots.change(opts) }; /* * Generate the Values of each box object and draw it * Update it together as well when called upon * @param * @return */ chart.boxPlots.update = function() { var currentName, currentBox; for(currentName in chart.groupObjs) { currentBox = chart.groupObjs[currentName].boxPlot; // Get Box Width var objBounds = getObjWidth(boxOptions.boxWidth, currentName); var width = (objBounds.right - objBounds.left); var scaledBoxMetrics = {}; for(var attr in chart.groupObjs[currentName].boxMetrics) { scaledBoxMetrics[attr] = null; scaledBoxMetrics[attr] = chart.yScale(chart.groupObjs[currentName].boxMetrics[attr]); } // Box if (currentBox.objs.box) { currentBox.objs.box .attr('x', objBounds.left) .attr('width', width) .attr('y', scaledBoxMetrics.quartile3) .attr('rx', 1) .attr('ry', 1) .attr('height', -scaledBoxMetrics.quartile3 + scaledBoxMetrics.quartile1); currentBox.objs.box.on('mouseover', function a() { chart.objs.tooltip .style('display', null) .style('left', (d3.event.pageX) + 'px') .style('top', (d3.event.pageY - 28) + 'px'); }) .on('mouseout', function b() { chart.objs.tooltip.style('display', 'none'); }) .on('mousemove', tooltipHover('metrics', currentName, chart.groupObjs[currentName].boxMetrics)); } // Lines var lineBounds = null; if(boxOptions.lineWidth) { lineBounds = getObjWidth(boxOptions.lineWidth, currentName); } else { lineBounds = objBounds; } // Whiskers if (currentBox.objs.upperWhisker) { currentBox.objs.upperWhisker.fence .attr('x1', lineBounds.left) .attr('x2', lineBounds.right) .attr('y1', scaledBoxMetrics.upperInnerFence) .attr('y2', scaledBoxMetrics.upperInnerFence); currentBox.objs.upperWhisker.line .attr('x1', lineBounds.middle) .attr('x2', lineBounds.middle) .attr('y1', scaledBoxMetrics.quartile3) .attr('y2', scaledBoxMetrics.upperInnerFence); currentBox.objs.lowerWhisker.fence .attr('x1', lineBounds.left) .attr('x2', lineBounds.right) .attr('y1', scaledBoxMetrics.lowerInnerFence) .attr('y2', scaledBoxMetrics.lowerInnerFence); currentBox.objs.lowerWhisker.line .attr('x1', lineBounds.middle) .attr('x2', lineBounds.middle) .attr('y1', scaledBoxMetrics.quartile1) .attr('y2', scaledBoxMetrics.lowerInnerFence); } // Median if (currentBox.objs.median) { currentBox.objs.median.line .attr('x1', lineBounds.left) .attr('x2', lineBounds.right) .attr('y1', scaledBoxMetrics.median) .attr('y2', scaledBoxMetrics.median); currentBox.objs.median.circle .attr('cx', lineBounds.middle) .attr('cy', scaledBoxMetrics.median); } // Mean if (currentBox.objs.mean) { currentBox.objs.mean.line .attr('x1', lineBounds.left) .attr('x2', lineBounds.right) .attr('y1', scaledBoxMetrics.mean) .attr('y2', scaledBoxMetrics.mean); currentBox.objs.mean.circle .attr('cx', lineBounds.middle) .attr('cy', scaledBoxMetrics.mean); } // Outliers var currentPoint; if(currentBox.objs.outliers && boxOptions.showOutliers) { for(currentPoint in currentBox.objs.outliers) { currentBox.objs.outliers[currentPoint].point .attr('cx', objBounds.middle + addJitter(boxOptions.scatterOutliers, width)) .attr('cy', chart.yScale(currentBox.objs.outliers[currentPoint].value)); } } // Extremes if(currentBox.objs.extremes && boxOptions.showOutliers) { for(currentPoint in currentBox.objs.extremes) { currentBox.objs.extremes[currentPoint].point .attr('cx', objBounds.middle + addJitter(boxOptions.scatterOutliers, width)) .attr('cy', chart.yScale(currentBox.objs.extremes[currentPoint].value)); } } } }; chart.boxPlots.prepareBoxPlot(); d3.select(window).on('resize.boxPlot', chart.boxPlots.update); chart.boxPlots.update(); return chart; }; /* * Render a violin plot on the current chart * @param options * @param [options.showViolinPlot=true] True or False, show the violin plot * @param [options.resolution=100 default] * @param [options.bandWidth=10 default] May need higher bandWidth for larger data sets * @param [options.width=50] The max percent of the group rangeBand that the violin can be * @param [options.interpolation=''] How to render the violin * @param [options.clamp=0 default] * 0 = keep data within chart min and max, clamp once data = 0. May extend beyond data set min and max * 1 = clamp at min and max of data set. Possibly no tails * -1 = extend chart axis to make room for data to interpolate to 0. May extend axis and data set min and max * @param [options.colors=chart default] The color mapping for the violin plot * @returns {*} The chart object */ chart.renderViolinPlot = function (options) { chart.violinPlots = {}; // Default options var defaultOptions = { show: true, showViolinPlot: true, resolution: 100, bandWidth: 20, width: 50, interpolation: d3.curveCardinal, clamp: 0, colors: chart.colorFunct, _yDomainVP: null // If the Violin plot is set to close all violin plots, it may need to extend the domain, that extended domain is stored here }; chart.violinPlots.options = clone(defaultOptions); for(var option in options) { chart.violinPlots.options[option] = options[option]; } var violinOptions = chart.violinPlots.options; // Create Plot Objects for each ticks of xAxis for (var currentName in chart.groupObjs) { chart.groupObjs[currentName].violin = {}; chart.groupObjs[currentName].violin.objs = {}; } /* * Take a new set of option and redraw violin * @param {object} updateOptions * @return */ chart.violinPlots.change = function (updateOptions) { if (updateOptions) { for (var option in updateOptions) { violinOptions[option] = updateOptions[option]; } } for (var currentName in chart.groupObjs) { chart.groupObjs[currentName].violin.objs.g.remove(); } chart.violinPlots.prepareViolin(); chart.violinPlots.update(); } /* * Epanechnikov function as a kernel function optimal in mean square error sense * CONSIDER OTHER KERNEL FUNCTIONS IN THE FUTURE: UNIFORM, TRIANGULAR, BIWEIGHT, TRIWEIGHT, NORMAL, ETC * @param {Float} scale * @return {function} function to do the calculation */ function eKernel(scale) { return function (u) { return Math.abs(u /= scale) <= 1 ? .75 * (1 - u * u) / scale : 0; }; } /* * Sample kernelDensityEstimator test function * Used to find the roots for adjusting violin axis * Given an array, find the value for a single point, even if it is not in the domain * @param {function} kernel, {array} array * @return {float} mean of all kernel function return values */ function eKernelTest(kernel, array) { return function (testX) { return d3.mean(array, function (v) {return kernel(testX - v);}) } } /* * Set violin show option to false * @param * @return */ chart.violinPlots.hide = function (opts) { if (opts !== undefined) { opts.show = false; if (opts.reset) { chart.violinPlots.reset() } } else { opts = {show: false}; } chart.violinPlots.change(opts); }; /* * Kernel Density Estimator function is a non-parametric way to estimate the probability density function of a set of random variable * Uses a range of kernel functions over a smoothing parameter from chart.violinPlots.option.bandWidth * @param {function} kernel, {array} array of values * @return {array} Array of objects with elements x: orignal value from array y: mean of all kernel function return values */ function kernelDensityEstimator(kernel, array) { return function (sample) { return array.map(function (val) { return {x:val, y:d3.mean(sample, function (v) {return kernel(val - v);})}; }); }; } /* * Create svg elements for the violin plot * @param * @return */ chart.violinPlots.prepareViolin = function() { var currentName, currentViolin; if(violinOptions.colors) { chart.violinPlots.color = getColorFunct(violinOptions.colors); } else { chart.violinPlots.color = chart.colorFunct; } if(violinOptions.show == false) { return; } for(currentName in chart.groupObjs) { currentViolin = chart.groupObjs[currentName].violin; currentViolin.objs.g = chart.groupObjs[currentName].g.append('g') .attr('class', 'violin-plot'); currentViolin.objs.left = { area: null, line: null, g: currentViolin.objs.g.append('g') }; currentViolin.objs.right = { area: null, line: null, g: currentViolin.objs.g.append('g') }; if(violinOptions.showViolinPlot !== false) { // Area currentViolin.objs.left.area = currentViolin.objs.left.g.append('path') .attr('class', 'area') .style('fill', chart.violinPlots.color(currentName)); currentViolin.objs.right.area = currentViolin.objs.right.g.append('path') .attr('class', 'area') .style('fill', chart.violinPlots.color(currentName)); // Stroke Around Area (Lines) currentViolin.objs.left.line = currentViolin.objs.left.g.append('path') .attr('class', 'line') .style('fill', 'none') .style('stroke', chart.violinPlots.color(currentName)); currentViolin.objs.right.line = currentViolin.objs.right.g.append('path') .attr('class', 'line') .style('fill', 'none') .style('stroke', chart.violinPlots.color(currentName)); } } }; /* * Reset the violin to default option * @param * @return */ chart.violinPlots.reset = function() { chart.violinPlots.change(defaultOptions); } /* * Set violin show option to true * @param * @return */ chart.violinPlots.show = function (opts) { if (opts !== undefined) { opts.show = true; if (opts.reset) { chart.violinPlots.reset() } } else { opts = {show: true}; } chart.violinPlots.change(opts); }; /* * Generate the Values of each violin object distribution * Update it together as well when called upon * @param * @return */ chart.violinPlots.update = function() { var currentName, currentViolin; for(currentName in chart.groupObjs) { currentViolin = chart.groupObjs[currentName].violin; // Build the line chart sideways to make a violin over the current distribution // Hence, use the current yScale for vioin xViolinScale var xViolinScale = chart.yScale.copy(); // Initialize Kernel Density Estimator Function currentViolin.kde = kernelDensityEstimator(eKernel(violinOptions.bandWidth), xViolinScale.ticks(violinOptions.resolution)); currentViolin.kdeData = currentViolin.kde(chart.groupObjs[currentName].values); // Initialize interpolation to min and max of the metrices var interpolateMax = chart.groupObjs[currentName].boxMetrics.max; var interpolateMin = chart.groupObjs[currentName].boxMetrics.min; if (violinOptions.clamp == 0 || violinOptions.clamp == -1) { // When clamp is 0, calculate the min and max that is needed to bring the violin plot to a point // interpolateMax = the Minimum value greater than the max where y = 0 interpolateMax = d3.min(currentViolin.kdeData.filter(function (d) { return (d.x > chart.groupObjs[currentName].boxMetrics.max && d.y == 0) }), function (d) { return d.x; }); // interpolateMin = the Maximum value less than the min where y = 0 interpolateMin = d3.max(currentViolin.kdeData.filter(function (d) { return (d.x < chart.groupObjs[currentName].boxMetrics.min && d.y == 0) }), function (d) { return d.x; }); // If clamp is -1 we need to extend the axises so that the violins come to a point if (violinOptions.clamp == -1){ var kdeTester = eKernelTest(eKernel(violinOptions.bandWidth), chart.groupObjs[currentName].values); if (!interpolateMax) { var interMaxY = kdeTester(chart.groupObjs[currentName].boxMetrics.max); var interMaxX = chart.groupObjs[currentName].boxMetrics.max; var count = 25; // Arbitrary limit to make sure we don't get an infinite loop while (count > 0 && interMaxY != 0) { interMaxY = kdeTester(interMaxX); interMaxX += 1; count -= 1; } interpolateMax = interMaxX; } if (!interpolateMin) { var interMinY = kdeTester(chart.groupObjs[currentName].boxMetrics.min); var interMinX = chart.groupObjs[currentName].boxMetrics.min; var count = 25; // Arbitrary limit to make sure we don't get an infinite loop while (count > 0 && interMinY != 0) { interMinY = kdeTester(interMinX); interMinX -= 1; count -= 1; } interpolateMin = interMinX; } } // Check to see if the new values are outside the existing chart range // If exist, they are assign to the master _yDomainVP if (!violinOptions._yDomainVP) violinOptions._yDomainVP = chart.range.slice(0); if (interpolateMin && interpolateMin < violinOptions._yDomainVP[0]) { violinOptions._yDomainVP[0] = interpolateMin; } if (interpolateMax && interpolateMax > violinOptions._yDomainVP[1]) { violinOptions._yDomainVP[1] = interpolateMax; } } if (violinOptions.showViolinPlot) { chart.update(); xViolinScale = chart.yScale.copy(); // Recalculate KDE as xViolinScale Changed currentViolin.kde = kernelDensityEstimator(eKernel(violinOptions.bandWidth), xViolinScale.ticks(violinOptions.resolution)); currentViolin.kdeData = currentViolin.kde(chart.groupObjs[currentName].values); } currentViolin.kdeData = currentViolin.kdeData .filter(function (d) { return (!interpolateMin || d.x >= interpolateMin) }) .filter(function (d) { return (!interpolateMax || d.x <= interpolateMax) }); } for(currentName in chart.groupObjs) { currentViolin = chart.groupObjs[currentName].violin; // Get the Violin object width var objBounds = getObjWidth(violinOptions.width, currentName); var width = (objBounds.right - objBounds.left) / 2; var yViolinScale = d3.scaleLinear() .range([width, 0]) .domain([0, d3.max(currentViolin.kdeData, function(d) {return d.y;})]) .clamp(true); var area = d3.area() .curve(violinOptions.interpolation) .x(function (d) {return xViolinScale(d.x);}) .y0(width) .y1(function (d) {return yViolinScale(d.y);}); var line = d3.line() .curve(violinOptions.interpolation) .x(function (d) {return xViolinScale(d.x);}) .y(function (d) {return yViolinScale(d.y);}); if (currentViolin.objs.left.area) { currentViolin.objs.left.area .datum(currentViolin.kdeData) .attr('d', area); currentViolin.objs.left.line .datum(currentViolin.kdeData) .attr('d', line); currentViolin.objs.right.area .datum(currentViolin.kdeData) .attr('d', area); currentViolin.objs.right.line .datum(currentViolin.kdeData) .attr('d', line); } // Rotate Violins currentViolin.objs.left.g.attr('transform', 'rotate(90,0,0) translate(0,-' + objBounds.left + ') scale(1,-1)'); currentViolin.objs.right.g.attr('transform', 'rotate(90,0,0) translate(0,-' + objBounds.right + ')'); } }; chart.violinPlots.prepareViolin(); d3.select(window).on('resize.violinPlot', chart.violinPlots.update); chart.violinPlots.update(); return chart; }; return chart; } return a3; })); // End a3
export const addColumn = columnData => { return { type: 'ADD_COLUMN', columnData } }; export const addCard = ({columnIdx, text, color}) => { return { type: 'ADD_CARD', columnIdx, text, color } }; export const removeColumn = columnIdx => { return { type: 'REMOVE_COLUMN', columnIdx } }; export const removeCard = ({columnIdx, cardIdx}) => { return { type: 'REMOVE_CARD', columnIdx, cardIdx } }; export const changeCardColor = ({columnIdx, cardIdx, color}) => { return { type: 'CHANGE_CARD_COLOR', columnIdx, cardIdx, color } }; export const replaceColumns = (source, target) => { return { type: 'REPLACE_COLUMNS', source, target } }; export const moveCardToColumn = (source, target) => { return { type: 'MOVE_CARD_TO_COLUMN', source, target } }; export const replaceCards = (source, target) => { return { type: 'REPLACE_CARDS', source, target } };
import React, { Component } from 'react'; export class ShipStats extends Component { constructor() { super() this.state = { shipHP: 650, hpChange: '' } this.getChange = this.getChange.bind(this) this.shipHpDown = this.shipHpDown.bind(this) this.shipHpUp = this.shipHpUp.bind(this) } shipHpDown() { this.setState(prevState => { return { shipHP: prevState.shipHP - this.state.hpChange, hpChange: '' } }) } shipHpUp() { this.setState(prevState => { let hpIncrease = prevState.shipHP + eval(this.state.hpChange) return { shipHP: hpIncrease , hpChange: '' } }) } getChange(event) { this.setState({ hpChange: event.target.value });//get change function console.log(this.state.hpChange) } render() { return ( <div className="ship-info"> <div className='ship-health'> <p className="ship-hp">{this.state.shipHP}</p> <div className="ship-health-interface"> <button className="interface-button ship-hp-minus" onClick={this.shipHpDown} >-</button> <input className='ship-hp-change' type='number' name='shipHpChange' value={this.state.hpChange} onChange={event => this.getChange(event)} /> <button className="interface-button ship-hp-plus" onClick={this.shipHpUp} >+</button> </div> </div> <div className='ship-stats'> <p className="ship-ac">16/20</p> <p className="ship-speed">130-200</p> </div> </div> ); } } export default ShipStats
/** * LINKURIOUS CONFIDENTIAL * Copyright Linkurious SAS 2012 - 2018 * * - Created on 2014-10-06. * * File: parsers.js * Description : This is a library of parsing functions used to retrieve * custom object representations from String to JS Objects */ 'use strict'; /** * Function that parses a string representing an array of parameters in a URL * and returns a JS array of Objects. The array represents a filter, [0] - * object property to filter on - [1] - value used to filter the * property. * * If there is no urlParameter, it returns an empty array * * @param {string} urlParameter Representing a filter: "name::bob|age::32" * @returns {Array} Actual JS Array object [['name', 'bob'],['age','32']] */ const parseUrlFilter = function(urlParameter) { if (!urlParameter || urlParameter.indexOf('::') === -1) { return []; } if (urlParameter.indexOf('|') !== -1) { const paramArray = urlParameter.split('|'); return paramArray.map(keyValuePair => { return keyValuePair.split('::'); }); } else { return [urlParameter.split('::')]; } }; exports.parseUrlFilter = parseUrlFilter;
import ArrowIcon from './ArrowIcon' import ArrowDownIcon from './ArrowDownIcon' import ArrowUpIcon from './ArrowUpIcon' import CartIcon from './CartIcon' import SearchIcon from './SearchIcon' import CheckIcon from './CheckIcon' import CheckboxIcon from './CheckboxIcon' import CheckboxCheckedIcon from './CheckboxCheckedIcon' import PlusCircleIcon from './PlusCircleIcon' import PlusIcon from './PlusIcon' import MinusIcon from './MinusIcon' import Triangle from './Triangle' import NodeCollapsedIcon from './NodeCollapsedIcon' import NodeExpandedIcon from './NodeExpandedIcon' import CloseIcon from './CloseIcon' import ReloadIcon from './ReloadIcon' import ExitIcon from './ExitIcon' import MenuIcon from './MenuIcon' import CircleIcon from './CircleIcon' import HelpIcon from './HelpIcon' import CheckmarkIcon from './CheckmarkIcon' import CommentIcon from './CommentIcon' import QuestionIcon from './QuestionIcon' import DataIcon from './DataIcon' import ClockIcon from './ClockIcon' import HeartIcon from './HeartIcon' import HeartBrokenIcon from './HeartBrokenIcon' import FavoriteIcon from './FavoriteIcon' import * as Flags from './flags' export { Flags, ArrowIcon, ArrowUpIcon, ArrowDownIcon, CartIcon, SearchIcon, CheckIcon, CheckboxIcon, CheckboxCheckedIcon, PlusCircleIcon, PlusIcon, MinusIcon, Triangle, NodeCollapsedIcon, NodeExpandedIcon, CloseIcon, ReloadIcon, ExitIcon, MenuIcon, CircleIcon, HelpIcon, CheckmarkIcon, CommentIcon, QuestionIcon, DataIcon, ClockIcon, HeartIcon, HeartBrokenIcon, FavoriteIcon, }
const readInput=require('./Utility/Utility'); var givenString="Hello <<UserName>>, How are you?"; do{ console.log("Enter User Name"); var username=readInput.getString(); if(username.length<3) console.log("Username must contain atleast 3 Characters"); }while(username.length<3); console.log(givenString.replace("<<UserName>>",username));
const readline = require('readline'); const fs = require('fs') const add = require('./modules/add'); const subtract = require('./modules/subtract'); const multiply = require('./modules/multiply'); const divide = require('./modules/divide'); const lessThan = require('./modules/lessThan'); const greaterThan = require('./modules/greaterThan'); const equalTo = require('./modules/equalTo'); const notEqualTo = require('./modules/NotEqualTo'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); let recallVar = []; let recallSometing = []; function quest() { rl.question('What would you like to know? ', (answer) => { let equation = answer.includes('+')||answer.includes('-')||answer.includes('*')||answer.includes('/')||answer.includes('<')||answer.includes('>')||answer.includes('===')||answer.includes('!='); if (equation) { let leftNum = []; let operator = []; let rightNum = []; for (let i=0; i<answer.length; i++) { let num = Number(answer[i]); if (num === 0 && operator.length != 0) { rightNum.push(num); } else if (num === 0 && operator.length === 0) { leftNum.push(num); } else if (!num) { operator.push(answer[i]); } else if (num && operator.length != 0) { rightNum.push(num); } else { leftNum.push(num); } } let lefty = leftNum.join(''); let sign = operator.join(''); let righty = rightNum.join(''); if (sign === '+') { console.log(add(Number(lefty), Number(righty))); } else if (sign === '-') { console.log(subtract(Number(lefty), Number(righty))); } else if (sign === '*') { console.log(multiply(Number(lefty), Number(righty))); } else if (sign === '/') { console.log(divide(Number(lefty), Number(righty))); } else if (sign === '<') { console.log(lessThan(Number(lefty), Number(righty))); } else if (sign === '>') { console.log(greaterThan(Number(lefty), Number(righty))); } else if (sign === '===') { console.log(equalTo(Number(lefty), Number(righty))); } else if (sign === '!=') { console.log(notEqualTo(Number(lefty), Number(righty))); } else console.log('Error: Cannot Compute'); } else if (answer.includes('let ')) { let vari = answer.replace('let ', ''); let varArr = []; let equl = []; let someting = []; for (let i=0; i<vari.length; i++) { let word = vari[i]; if (word === '=') { equl.push(word); } else if (word != '=' && equl.length != 0) { someting.push(word); } else if (word != '=') { varArr.push(word); } } let newVar = varArr.join('').trim(); let newSometing = someting.join('').trim(); recallVar.push(newVar); recallSometing.push(newSometing); } else if (recallVar.includes(answer)) { function recall(index) { return index == answer } console.log(recallSometing[recallVar.findIndex(recall)]); } else { console.log('Syntax Error') } quest(); }); } quest();
function check(){ var n = Number(document.getElementById("num").value); var c = 0; //for numbers 1 and 2 if(n == 1){ document.getElementById("ans").value = "Not Prime"; } if(n == 2){ document.getElementById("ans").value = "Prime"; } //for numbers other than 2 //increments c every time (x % n) is 0 for(x = 1 ; x <= n; x++){ if((n % x) == 0){ c = c + 1; } } //for prime numbers c should be equal to two //prime numbers have only two positive factors if(c == 2){ document.getElementById("ans").value = " Prime "; } else{ document.getElementById("ans").value = "Not Prime"; } } //clear function //clear input fields function clr(){ document.getElementById("num").value = ""; document.getElementById("ans").value = " "; }
import dataFetch from '@/utils/request' export default { // 服务说明 async getServeInfo (params) { return dataFetch('/goods/serviceDetail', params) }, // 赔付列表 async getApplyList (params) { return dataFetch('/reparation/applyList', params) }, // 申请赔付 async getCheckUnusedOp () { return dataFetch('/reparation/checkUnusedOp') }, // 获取比价平台 async getPlatformList () { return dataFetch('/reparation/platformList') }, // 获取赔付商品列表 async getOrderProductList (params) { return dataFetch('/reparation/orderProductList', params) }, // 赔付商品 async getOrderProduct (params) { return dataFetch('/reparation/orderProduct', params) }, // 上传图片 async getUploadImg (params) { return dataFetch('/reparation/uploadImg', params) }, // 提交申请 async getAddApply (params) { return dataFetch('/reparation/addApply', params) } }
import jwt from 'jsonwebtoken'; import { findUser } from '../data-access/user.js'; import NotFoundError from '../errors/notFound.js'; export default class AuthService { static async login({ login, password }) { const isUserExist = !!(await findUser(login, password)); if (isUserExist) { const token = AuthService.generateAccessToken(login); return { token }; } throw new NotFoundError( 'User with current login and password was not found', ); } static generateAccessToken(login) { return jwt.sign({ login }, process.env.TOKEN_SECRET, { expiresIn: process.env.TOKEN_EXPIRATION_TIME, }); } }
import React, { Component } from "react"; import "./assets/css/footer.css"; class Footer extends Component { render() { return ( <div className="footer"> <div className="wrapper"> <div className="info-block"> <div className="info"> <div className="field"> Nam mi enim, auctor non ultricies a, fringilla eu risus. Praesent vitae lorem et elit tincidunt accumsan suscipit eu libero. Maecenas diam est, venenatis vitae dui in, vestibulum mollis arcu. Donec eu nibh tincidunt, dapibus sem eu, aliquam dolor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum consectetur commodo eros, vitae laoreet lectus aliq </div> <div className="field"> aliquam dolor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum consectetur commodo eros, vitae laoreet lectus aliq </div> </div> <div className="footer-links"> <a href="/">List one</a> <a href="/">Page two</a> <a href="/">Design</a> <a href="/">Work</a> <a href="/">Contact Me</a> </div> </div> <div className="figure" /> <div className="footer-signature">FINALIZED BY DMITRY BADARANCHA</div> </div> </div> ); } } export default Footer;
export default [ { path: "/", redirect: "/app" }, { path: "/app", name: "app", meta: { title: "应用分析" }, component: () => import("views/App.vue") }, { path: "/push", name: "push", meta: { title: "推送营销" }, component: () => import("views/Push.vue") }, { path: "/dev", name: "dev", meta: { title: "开发助手" }, component: () => import("views/Dev.vue") }, { path: "/manage", name: "manage", meta: { title: "应用管理" }, component: () => import("views/Manage.vue") }, { path: "/dashboard", name: "dashboard", meta: { title: "仪表盘" }, component: () => import("views/Dashboard.vue") }, { path: "/table1", name: "table1", meta: { title: "表格1" }, component: () => import("views/Table1.vue") }, { path: "*", name: "page_not_found", meta: { title: "页面不存在" }, component: () => import("views/PageNotFound.vue") } ];
function solution(people, limit) { var answer = 0; // 오름차순 정렬 people.sort((a, b) => a - b); // 시작 Flag let left = 0; let right = people.length - 1; while(left < right){ if (limit >= people[left] + people[right]){ left += 1; right -= 1; answer += 1; } else{ right -= 1; answer += 1; } } if (left == right){ answer += 1; } return answer; }
import { reactive, toRefs } from "vue"; export const useCount = () => { const state = reactive({ count: 0 }); return toRefs(state); }
import React, { Component } from 'react'; // import { browserHistory } from 'react-router'; class CartItem extends Component { render() { return (<div className="column is-one-third-mobile is-one-third-tablet is-one-quarter-desktop is-offset-4 productCard"> <div className="section"> <img className="productImgBuild" src={this.props.productImg} alt="cart item"/> <h4 className="productTitleBuild">{this.props.productTitle} &#8212; <span className="productPriceBuild">{this.props.productPrice}</span></h4> <h4 className="productQuantityBuild">Quantity {this.props.selectedQuantity}</h4> <p className="field is-grouped"> <a className="button is-outlined"> <span>Edit Item</span> <span className="icon is-small"> <i className="fa fa-times"></i> </span> </a> <a className="button is-danger is-outlined"> <span>Remove Item</span> <span className="icon is-small"> <i className="fa fa-times"></i> </span> </a> </p> </div> </div> ); } } export default CartItem;
import HtmlWebPackPlugin from "html-webpack-plugin"; import ExtractTextPlugin from "extract-text-webpack-plugin"; export default (env, argv) => { return { module: { rules: [{ test: /\.js$/, exclude: /node_modules/, use: { loader: "babel-loader" } }, { test: /\.(s*)css$/, // use: ExtractTextPlugin.extract( // { // fallback: 'style-loader', // use: ['css-loader','sass-loader'] // }), use() { if (argv.mode === 'development') { return ExtractTextPlugin.extract( { fallback: 'style-loader', use: ['css-loader','sass-loader'] } ) } return [ { loader: "style-loader" }, { loader: "css-loader" }, { loader: "sass-loader" }, ] } }, { test: /\.(png|jpg|gif)$/, use: [{ loader: 'file-loader', options: { name(file) { if (argv.mode === 'development') { return 'images/[name].[ext]' } return 'images/[hash].[ext]' }, context: '', } }] } ] }, plugins: [ new HtmlWebPackPlugin({ template: "./public/index.html", filename: "./index.html", title: 'React Image Mapper Component', }), new ExtractTextPlugin( { filename: 'style.bundle.css' } ), ], } }
var searchData= [ ['players',['players',['../structgame.html#a61d36a149f0d4d23b4ec8bff3a256d9f',1,'game']]] ];
import fili from 'fili'; import numjs from 'numjs'; export class SignalFilter { constructor() { this.processor = new fili.CalcCascades(); } lowpass(signal) { const coeffs = this.processor.lowpass({ order: 10, characteristic: 'butterworth', Fs: 360, Fc: 55, }); return new fili.IirFilter(coeffs).multiStep(signal); } highpass(signal) { const coeffs = this.processor.highpass({ order: 10, characteristic: 'butterworth', Fs: 360, Fc: 1, }); return new fili.IirFilter(coeffs).multiStep(signal); } bandpass(signal) { const coeffs = this.processor.bandpass({ order: 10, characteristic: 'butterworth', Fs: 360, F1: 1, F2: 55 }); return new fili.IirFilter(coeffs).multiStep(signal); } median(signal, width) { const result = []; for(let i = 0; i < signal.length; i++) { const arr = []; for(let j = -(width >> 1); j <= (width >> 1); j++) { let pos = i + j; // Out of bounds prevent, use mirroring if(pos < 0) pos = -pos; if(pos >= signal.length) pos = i - pos; // Push value into subarray arr.push(signal[pos]); } // Calculate median value const med = arr.sort()[width >> 1]; // Set filtered value result.push(med); } return result; } }
import axios from 'axios'; // Custom Imports import Constant from '../constant'; function getToken() { let token = localStorage.getItem('token'); return token; } // Function to request login function registerPractice(user) { return axios({ data: user, method: 'POST', url: `${Constant.API_URL}/registerPractice`, }); } function login(user) { return axios({ data: user, method: 'POST', url: `${Constant.API_URL}/login`, }); } function getPracticeDetails(practiceId) { return axios({ method: 'GET', url: `${Constant.API_URL}/getPracticeDetails/${practiceId}`, }); } function getCalendarSlots(data) { return axios({ headers: { 'x-access-token': getToken(), contentType: 'application/json', }, method: 'GET', url: `${Constant.API_URL}/practice/${data.practiceId}/getCalendarSlots/service/${data.serviceId}`, }); } function getCalendarBookings(data) { return axios({ headers: { 'x-access-token': getToken(), contentType: 'application/json', }, method: 'GET', url: `${Constant.API_URL}/practice/${data.practiceId}/getCalendarBookings/service/${data.serviceId}`, }); } function getBookings(data) { return axios({ headers: { 'x-access-token': getToken(), contentType: 'application/json', }, method: 'GET', url: `${Constant.API_URL}/practice/${data.practiceId}/getBookingHistory/service/${data.serviceId}`, }); } function getPrices(practiceId) { return axios({ method: 'GET', url: `${Constant.API_URL}/getPrices/${practiceId}`, }); } function getSlots(data) { return axios({ method: 'GET', url: `${Constant.API_URL}/getSlots/${data.practiceId}/service/${data.serviceId}?date=${data.date}`, }); } function registerPrice(data) { return axios({ data: { service: data.service, price: data.price }, headers: { 'x-access-token': getToken(), contentType: 'application/json', }, method: 'POST', url: `${Constant.API_URL}/practice/${data.practiceId}/registerPrices`, }); } function updatePrice(data) { return axios({ data: { priceId: data.priceId, service: data.service, price: data.price }, headers: { 'x-access-token': getToken(), contentType: 'application/json', }, method: 'POST', url: `${Constant.API_URL}/practice/${data.practiceId}/updatePrice`, }); } function deletePrice(data) { return axios({ data: { priceId: data.priceId }, headers: { 'x-access-token': getToken(), contentType: 'application/json', }, method: 'POST', url: `${Constant.API_URL}/practice/${data.practiceId}/deletePrice`, }); } function getServices(practiceId) { return axios({ method: 'GET', url: `${Constant.API_URL}/getServices/${practiceId}`, }); } function registerService(data) { return axios({ data: { serviceName: data.serviceName, }, headers: { 'x-access-token': getToken(), contentType: 'application/json', }, method: 'POST', url: `${Constant.API_URL}/practice/${data.practiceId}/registerServices`, }); } function updateService(data) { return axios({ data: { serviceId: data.serviceId, serviceName: data.serviceName }, headers: { 'x-access-token': getToken(), contentType: 'application/json', }, method: 'POST', url: `${Constant.API_URL}/practice/${data.practiceId}/updateService`, }); } function deleteService(data) { return axios({ data: { serviceId: data.serviceId }, headers: { 'x-access-token': getToken(), contentType: 'application/json', }, method: 'POST', url: `${Constant.API_URL}/practice/${data.practiceId}/deleteService`, }); } function getTimings(practiceId) { return axios({ method: 'GET', url: `${Constant.API_URL}/getTimings/${practiceId}`, }); } function registerTiming(data) { return axios({ data: { day: data.day, from: data.from, to: data.to, closed: data.closed }, headers: { 'x-access-token': getToken(), contentType: 'application/json', }, method: 'POST', url: `${Constant.API_URL}/practice/${data.practiceId}/registerTimings`, }); } function updateTiming(data) { return axios({ data: { timingId: data.timingId, from: data.from, to: data.to, closed: data.closed }, headers: { 'x-access-token': getToken(), contentType: 'application/json', }, method: 'POST', url: `${Constant.API_URL}/practice/${data.practiceId}/updateTiming`, }); } function deleteTiming(data) { return axios({ data: { timingId: data.timingId }, headers: { 'x-access-token': getToken(), contentType: 'application/json', }, method: 'POST', url: `${Constant.API_URL}/practice/${data.practiceId}/deleteTiming`, }); } function addSlot(data) { return axios({ data: { fromTime: data.fromTime, serviceId: data.serviceId }, headers: { 'x-access-token': getToken(), contentType: 'application/json', }, method: 'POST', url: `${Constant.API_URL}/practice/${data.practiceId}/addSlot`, }); } function deleteSlot(data) { return axios({ data: { fromTime: data.fromTime, slotId: data.slotId }, headers: { 'x-access-token': getToken(), contentType: 'application/json', }, method: 'POST', url: `${Constant.API_URL}/practice/${data.practiceId}/deleteSlot`, }); } function addBooking(data) { return axios({ data: data, headers: { contentType: 'application/json', }, method: 'POST', url: `${Constant.API_URL}/booking`, }); } function cancelBooking(data) { return axios({ data: { slotId: data.slotId, bookingId: data.bookingId }, headers: { 'x-access-token': getToken(), contentType: 'application/json', }, method: 'POST', url: `${Constant.API_URL}/practice/${data.practiceId}/cancelBooking`, }); } function viewBooking(data) { return axios({ headers: { 'x-access-token': getToken(), contentType: 'application/json', }, method: 'GET', url: `${Constant.API_URL}/practice/${data.practiceId}/getBooking/service/${data.serviceId}?fromTime=${data.fromTime}`, }); } export default { registerPractice, login, getPracticeDetails, getCalendarSlots, getCalendarBookings, getBookings, getPrices, getSlots, registerPrice, updatePrice, deletePrice, getServices, registerService, updateService, deleteService, getTimings, registerTiming, updateTiming, deleteTiming, addSlot, deleteSlot, addBooking, cancelBooking, viewBooking, };
const cityLetter = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] const getItem = (letter, list) => { let arr = [] list && list.map(item => { if (item.searchKey == letter) { var _item = { name: item.addressName, code: item.addressCode } arr.push(_item) } }) return arr } export default { addrList: state => { return state.addrData && state.addrData.allCodeList }, isHideSea: state => { return state.addrData && state.addrData.isHideSea }, stateArr: state => { if (state.addrData) { let arr = [] const allList = state.addrData.allCodeList cityLetter.map(listItem => { let itemArr = getItem(listItem, allList) if (itemArr.length > 0) { arr.push({ letter: listItem, list: itemArr }) } }) return arr } return null }, hostList: state => { return state.addrData && state.addrData.hotCodeList }, userInfo: state => { return state.userInfo } }
/* eslint-disable no-underscore-dangle */ import Phaser from 'phaser'; import api from '../config/apiconf'; import gameOpt from '../config/gameOptions'; export default class userRecord extends Phaser.Scene { constructor() { super({ key: 'rexUI', }); this.count = 1; } preload() { let url; url = 'https://raw.githubusercontent.com/rexrainbow/phaser3-rex-notes/master/dist/rexbbcodetextplugin.min.js'; this.load.plugin('rexbbcodetextplugin', url, true); url = 'https://raw.githubusercontent.com/rexrainbow/phaser3-rex-notes/master/dist/rextexteditplugin.min.js'; this.load.plugin('rextexteditplugin', url, true); } create() { this.add.image(400, 300, 'background'); const keyObj = this.input.keyboard.addKey('Enter'); const printText = this.add.rexBBCodeText(400, 300, 'abc', { color: 'yellow', fontSize: '24px', fixedWidth: 200, backgroundColor: '#333333', }) .setOrigin(0.5) .setInteractive() .on('pointerdown', () => { // console.log(this.plugins.get('rextexteditplugin').edit(printText)); this.count = 0; this.plugins.get('rextexteditplugin').edit(printText); keyObj.on('down', () => { if (this.count === 0) { this.count = 1; // eslint-disable-next-line no-underscore-dangle api.postScore(printText._text, gameOpt.gameOptions.score); this.scene.start('Title'); } }); }, this); this.add.text(0, 580, 'Click text to start editing, press enter key to stop editing'); } }
import React from 'react'; import {View,Text,StyleSheet,Alert} from 'react-native'; import axios from 'axios'; export default class HomeScreen extends React.Component{ constructor(props){ super(props); this.state={ list_data:[], url:'http://127.0.0.1:5000/' } } getData= async()=>{ const url = await this.state.url axios .get(url) .then(response=>{ return this.setState({ list_data:response.data.data }) }) .catch(err=>{ Alert.alert(err.message); }) } renderItem=({item,index})=>( <ListItem key={index} title={`star_name:${item.star_name}`} subtitle = {`distance :${item.distance}`} titleStyle = {styles.title} containerStyle = {styles.list_container} bottomDivider chevron onPress={()=>{this.props.navigation.navigate("Details",{star_name:item.star_name})}} /> ) keyExtractor = (item,index)=>item.toString() componentDidMount(){ this.getData(); } render(){ const {list_data} = this.state if(list_data.length === 0){ return (<View style={styles.emptyContainer} > <Text> Loading..... </Text> </View> ) } return( <View style={styles.container}> <SafeAreaView/> <View style={styles.upperContainer}> <Text style={styles.headerText}> Star World </Text> </View> <View style={styles.lowerContainer}> <FlatList keyExtractor={this.keyExtractor} data = {this.state.list_data} renderItem = {this.renderItem} /> </View> </View> ) } } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: "#edc988" }, upperContainer: { flex: 0.1, justifyContent: "center", alignItems: "center" }, headerText: { fontSize: 30, fontWeight: "bold", color: "#132743" }, lowerContainer: { flex: 0.9 }, emptyContainer: { flex: 1, justifyContent: "center", alignItems: "center" }, emptyContainerText: { fontSize: 20 }, title: { fontSize: 18, fontWeight: "bold", color: "#d7385e" }, listContainer: { backgroundColor: "#eeecda" } });
module.exports = { "id": "startAppeal", "name": "Start your appeal", "description": "Start your appeal", "case_id": null, "case_fields": [ { "id": "checklistTitle", "label": "# Tell us about your client", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "checklistTitle2", "label": "If you cannot use the new online service due to your client's circumstances, you can <a href=\"https://immigrationappealsonline.justice.gov.uk/IACFees\" target=\"_blank\">appeal using the current online service</a> or appeal by post or fax using <a href=\"https://www.gov.uk/government/publications/appeal-a-visa-or-immigration-decision-within-the-uk-form-iaft-5\" target=\"_blank\">form IAFT-5</a>.", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "checklist", "label": "", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "checklist", "type": "Complex", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [ { "id": "checklist5", "label": "", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "MultiSelectList-checklist5", "type": "MultiSelectList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "isResidingInUK", "label": "My client is living in the UK", "order": null } ], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null }, { "id": "checklist1", "label": "", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "MultiSelectList-checklist1", "type": "MultiSelectList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "isAdult", "label": "My client is at least 18 years old", "order": null } ], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": "checklist1=\"DUMMY_VALUE_TO_HIDE_FIELD\"", "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null }, { "id": "checklist2", "label": "", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "MultiSelectList-checklist2", "type": "MultiSelectList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "isNotDetained", "label": "My client is not in detention", "order": null } ], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null }, { "id": "checklist7", "label": "", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "MultiSelectList-checklist7", "type": "MultiSelectList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "isNotEUDecision", "label": "My client is not appealing an EU Settlement Scheme decision", "order": null } ], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null }, { "id": "checklist3", "label": "", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "MultiSelectList-checklist3", "type": "MultiSelectList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "isNotFamilyAppeal", "label": "My client is not appealing with anyone else as part of a linked or grouped appeal", "order": null } ], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null }, { "id": "checklist4", "label": "", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "MultiSelectList-checklist4", "type": "MultiSelectList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "isWithinPostcode", "label": "My client is located in one of these postcodes: BN, CB, CM, HP, IP, ME, N, NR, RH, SE, TN, W, L, LA, M, OL, PR, SK, WA, WN", "order": null } ], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": "checklist4=\"DUMMY_VALUE_TO_HIDE_FIELD\"", "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null }, { "id": "checklist6", "label": "", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "MultiSelectList-checklist6", "type": "MultiSelectList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "isNotStateless", "label": "My client is not stateless", "order": null } ], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": "checklist6=\"DUMMY_VALUE_TO_HIDE_FIELD\"", "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null } ], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "homeOfficeDecisionTitle", "label": "# Home office details", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "homeOfficeReferenceNumber", "label": "Home Office reference", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Text", "type": "Text", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "homeOfficeDecisionLetterImage", "label": "![Image of Home Office decision letter](https://raw.githubusercontent.com/hmcts/ia-appeal-frontend/master/app/assets/images/home-office-letter.png)", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true } ] }, { "id": "homeOfficeDecisionDate", "label": "Enter the date the decision letter was sent", "hidden": null, "value": null, "metadata": false, "hint_text": "You can usally find this stamped on the evelope. Alternatively enter the\ndate given to the decision letter.\n\nFor example, 03 04 2019", "field_type": { "id": "Date", "type": "Date", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "homeOfficeDecisionEnvelopeImage", "label": "![Image of Home Office decision evelope](https://raw.githubusercontent.com/hmcts/ia-appeal-frontend/master/app/assets/images/homeOffice-decision-envelope.png)", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true } ] }, { "id": "appellantBasicDetailsTitle", "label": "# Basic details\nEnter the basic details for your client.", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appellantTitle", "label": "Title", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Text", "type": "Text", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appellantGivenNames", "label": "Given names", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Text", "type": "Text", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appellantFamilyName", "label": "Family name", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Text", "type": "Text", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appellantDateOfBirth", "label": "Date of birth", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Date", "type": "Date", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appellantNationalities", "label": "Nationality", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "appellantNationalities-2f8b9a15-a4ff-4bdc-bd1d-504b31fd1cfd", "type": "Collection", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": { "id": "nationality", "type": "Complex", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [ { "id": "code", "label": "Nationality", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "FixedList-isoCountries", "type": "FixedList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "ZW", "label": "Zimbabwe", "order": null }, { "code": "ZM", "label": "Zambia", "order": null }, { "code": "YE", "label": "Yemen", "order": null }, { "code": "EH", "label": "Western Sahara", "order": null }, { "code": "WF", "label": "Wallis and Futuna Islands", "order": null }, { "code": "VI", "label": "Virgin Islands, US", "order": null }, { "code": "VN", "label": "Viet Nam", "order": null }, { "code": "VE", "label": "Venezuela (Bolivarian Republic of)", "order": null }, { "code": "VU", "label": "Vanuatu", "order": null }, { "code": "UZ", "label": "Uzbekistan", "order": null }, { "code": "UY", "label": "Uruguay", "order": null }, { "code": "UM", "label": "United States Minor Outlying Islands", "order": null }, { "code": "US", "label": "United States of America", "order": null }, { "code": "GB", "label": "United Kingdom", "order": null }, { "code": "AE", "label": "United Arab Emirates", "order": null }, { "code": "UA", "label": "Ukraine", "order": null }, { "code": "UG", "label": "Uganda", "order": null }, { "code": "TV", "label": "Tuvalu", "order": null }, { "code": "TC", "label": "Turks and Caicos Islands", "order": null }, { "code": "TM", "label": "Turkmenistan", "order": null }, { "code": "TR", "label": "Turkey", "order": null }, { "code": "TN", "label": "Tunisia", "order": null }, { "code": "TT", "label": "Trinidad and Tobago", "order": null }, { "code": "TO", "label": "Tonga", "order": null }, { "code": "TK", "label": "Tokelau", "order": null }, { "code": "TG", "label": "Togo", "order": null }, { "code": "TL", "label": "Timor-Leste", "order": null }, { "code": "TH", "label": "Thailand", "order": null }, { "code": "TZ", "label": "Tanzania *, United Republic of", "order": null }, { "code": "TJ", "label": "Tajikistan", "order": null }, { "code": "TW", "label": "Taiwan", "order": null }, { "code": "SY", "label": "Syrian Arab Republic (Syria)", "order": null }, { "code": "CH", "label": "Switzerland", "order": null }, { "code": "SE", "label": "Sweden", "order": null }, { "code": "SZ", "label": "Swaziland", "order": null }, { "code": "SJ", "label": "Svalbard and Jan Mayen Islands", "order": null }, { "code": "SR", "label": "Suriname *", "order": null }, { "code": "SD", "label": "Sudan", "order": null }, { "code": "LK", "label": "Sri Lanka", "order": null }, { "code": "ES", "label": "Spain", "order": null }, { "code": "SS", "label": "South Sudan", "order": null }, { "code": "GS", "label": "South Georgia and the South Sandwich Islands", "order": null }, { "code": "ZA", "label": "South Africa", "order": null }, { "code": "SO", "label": "Somalia", "order": null }, { "code": "SB", "label": "Solomon Islands", "order": null }, { "code": "SI", "label": "Slovenia", "order": null }, { "code": "SK", "label": "Slovakia", "order": null }, { "code": "SX", "label": "Sint Maarten (Dutch part)", "order": null }, { "code": "SG", "label": "Singapore", "order": null }, { "code": "SL", "label": "Sierra Leone", "order": null }, { "code": "SC", "label": "Seychelles", "order": null }, { "code": "RS", "label": "Serbia", "order": null }, { "code": "SN", "label": "Senegal", "order": null }, { "code": "SA", "label": "Saudi Arabia", "order": null }, { "code": "ST", "label": "Sao Tome and Principe", "order": null }, { "code": "SM", "label": "San Marino", "order": null }, { "code": "WS", "label": "Samoa", "order": null }, { "code": "VC", "label": "Saint Vincent and Grenadines", "order": null }, { "code": "PM", "label": "Saint Pierre and Miquelon", "order": null }, { "code": "MF", "label": "Saint-Martin (French part)", "order": null }, { "code": "LC", "label": "Saint Lucia", "order": null }, { "code": "KN", "label": "Saint Kitts and Nevis", "order": null }, { "code": "SH", "label": "Saint Helena", "order": null }, { "code": "BL", "label": "Saint-Barthélemy", "order": null }, { "code": "RW", "label": "Rwanda", "order": null }, { "code": "RU", "label": "Russian Federation", "order": null }, { "code": "RO", "label": "Romania", "order": null }, { "code": "RE", "label": "Réunion", "order": null }, { "code": "QA", "label": "Qatar", "order": null }, { "code": "PR", "label": "Puerto Rico", "order": null }, { "code": "PT", "label": "Portugal", "order": null }, { "code": "PL", "label": "Poland", "order": null }, { "code": "PN", "label": "Pitcairn", "order": null }, { "code": "PH", "label": "Philippines", "order": null }, { "code": "PE", "label": "Peru", "order": null }, { "code": "PY", "label": "Paraguay", "order": null }, { "code": "PG", "label": "Papua New Guinea", "order": null }, { "code": "PA", "label": "Panama", "order": null }, { "code": "PS", "label": "Palestinian Territory, Occupied", "order": null }, { "code": "PW", "label": "Palau", "order": null }, { "code": "PK", "label": "Pakistan", "order": null }, { "code": "OM", "label": "Oman", "order": null }, { "code": "NO", "label": "Norway", "order": null }, { "code": "MP", "label": "Northern Mariana Islands", "order": null }, { "code": "NF", "label": "Norfolk Island", "order": null }, { "code": "NU", "label": "Niue", "order": null }, { "code": "NG", "label": "Nigeria", "order": null }, { "code": "NE", "label": "Niger", "order": null }, { "code": "NI", "label": "Nicaragua", "order": null }, { "code": "NZ", "label": "New Zealand", "order": null }, { "code": "NC", "label": "New Caledonia", "order": null }, { "code": "AN", "label": "Netherlands Antilles", "order": null }, { "code": "NL", "label": "Netherlands", "order": null }, { "code": "NP", "label": "Nepal", "order": null }, { "code": "NR", "label": "Nauru", "order": null }, { "code": "NA", "label": "Namibia", "order": null }, { "code": "MM", "label": "Myanmar", "order": null }, { "code": "MZ", "label": "Mozambique", "order": null }, { "code": "MA", "label": "Morocco", "order": null }, { "code": "MS", "label": "Montserrat", "order": null }, { "code": "ME", "label": "Montenegro", "order": null }, { "code": "MN", "label": "Mongolia", "order": null }, { "code": "MC", "label": "Monaco", "order": null }, { "code": "MD", "label": "Moldova", "order": null }, { "code": "FM", "label": "Micronesia, Federated States of", "order": null }, { "code": "MX", "label": "Mexico", "order": null }, { "code": "YT", "label": "Mayotte", "order": null }, { "code": "MU", "label": "Mauritius", "order": null }, { "code": "MR", "label": "Mauritania", "order": null }, { "code": "MQ", "label": "Martinique", "order": null }, { "code": "MH", "label": "Marshall Islands", "order": null }, { "code": "MT", "label": "Malta", "order": null }, { "code": "ML", "label": "Mali", "order": null }, { "code": "MV", "label": "Maldives", "order": null }, { "code": "MY", "label": "Malaysia", "order": null }, { "code": "MW", "label": "Malawi", "order": null }, { "code": "MG", "label": "Madagascar", "order": null }, { "code": "MK", "label": "Macedonia, Republic of", "order": null }, { "code": "LU", "label": "Luxembourg", "order": null }, { "code": "LT", "label": "Lithuania", "order": null }, { "code": "LI", "label": "Liechtenstein", "order": null }, { "code": "LY", "label": "Libya", "order": null }, { "code": "LR", "label": "Liberia", "order": null }, { "code": "LS", "label": "Lesotho", "order": null }, { "code": "LB", "label": "Lebanon", "order": null }, { "code": "LV", "label": "Latvia", "order": null }, { "code": "LA", "label": "Lao PDR", "order": null }, { "code": "KG", "label": "Kyrgyzstan", "order": null }, { "code": "KW", "label": "Kuwait", "order": null }, { "code": "KR", "label": "Korea, Republic of", "order": null }, { "code": "KP", "label": "Korea, Democratic People's Republic of", "order": null }, { "code": "KI", "label": "Kiribati", "order": null }, { "code": "KE", "label": "Kenya", "order": null }, { "code": "KZ", "label": "Kazakhstan", "order": null }, { "code": "JO", "label": "Jordan", "order": null }, { "code": "JE", "label": "Jersey", "order": null }, { "code": "JP", "label": "Japan", "order": null }, { "code": "JM", "label": "Jamaica", "order": null }, { "code": "IT", "label": "Italy", "order": null }, { "code": "IL", "label": "Israel", "order": null }, { "code": "IM", "label": "Isle of Man", "order": null }, { "code": "IE", "label": "Ireland", "order": null }, { "code": "IQ", "label": "Iraq", "order": null }, { "code": "IR", "label": "Iran, Islamic Republic of", "order": null }, { "code": "ID", "label": "Indonesia", "order": null }, { "code": "IN", "label": "India", "order": null }, { "code": "IS", "label": "Iceland", "order": null }, { "code": "HU", "label": "Hungary", "order": null }, { "code": "HN", "label": "Honduras", "order": null }, { "code": "VA", "label": "Holy See (Vatican City State)", "order": null }, { "code": "HM", "label": "Heard Island and Mcdonald Islands", "order": null }, { "code": "HT", "label": "Haiti", "order": null }, { "code": "GY", "label": "Guyana", "order": null }, { "code": "GW", "label": "Guinea-Bissau", "order": null }, { "code": "GN", "label": "Guinea", "order": null }, { "code": "GG", "label": "Guernsey", "order": null }, { "code": "GT", "label": "Guatemala", "order": null }, { "code": "GU", "label": "Guam", "order": null }, { "code": "GP", "label": "Guadeloupe", "order": null }, { "code": "GD", "label": "Grenada", "order": null }, { "code": "GL", "label": "Greenland", "order": null }, { "code": "GR", "label": "Greece", "order": null }, { "code": "GI", "label": "Gibraltar", "order": null }, { "code": "GH", "label": "Ghana", "order": null }, { "code": "DE", "label": "Germany", "order": null }, { "code": "GE", "label": "Georgia", "order": null }, { "code": "GM", "label": "Gambia", "order": null }, { "code": "GA", "label": "Gabon", "order": null }, { "code": "TF", "label": "French Southern Territories", "order": null }, { "code": "PF", "label": "French Polynesia", "order": null }, { "code": "GF", "label": "French Guiana", "order": null }, { "code": "FR", "label": "France", "order": null }, { "code": "FI", "label": "Finland", "order": null }, { "code": "FJ", "label": "Fiji", "order": null }, { "code": "FO", "label": "Faroe Islands", "order": null }, { "code": "FK", "label": "Falkland Islands (Malvinas)", "order": null }, { "code": "ET", "label": "Ethiopia", "order": null }, { "code": "EE", "label": "Estonia", "order": null }, { "code": "ER", "label": "Eritrea", "order": null }, { "code": "GQ", "label": "Equatorial Guinea", "order": null }, { "code": "SV", "label": "El Salvador", "order": null }, { "code": "EG", "label": "Egypt", "order": null }, { "code": "EC", "label": "Ecuador", "order": null }, { "code": "DO", "label": "Dominican Republic", "order": null }, { "code": "DM", "label": "Dominica", "order": null }, { "code": "DJ", "label": "Djibouti", "order": null }, { "code": "DK", "label": "Denmark", "order": null }, { "code": "CZ", "label": "Czech Republic", "order": null }, { "code": "CY", "label": "Cyprus", "order": null }, { "code": "CW", "label": "Curaçao", "order": null }, { "code": "CU", "label": "Cuba", "order": null }, { "code": "HR", "label": "Croatia", "order": null }, { "code": "CI", "label": "Côte d'Ivoire", "order": null }, { "code": "CR", "label": "Costa Rica", "order": null }, { "code": "CK", "label": "Cook Islands", "order": null }, { "code": "CD", "label": "Congo, Democratic Republic of the", "order": null }, { "code": "CG", "label": "Congo (Brazzaville)", "order": null }, { "code": "KM", "label": "Comoros", "order": null }, { "code": "CO", "label": "Colombia", "order": null }, { "code": "CC", "label": "Cocos (Keeling) Islands", "order": null }, { "code": "CX", "label": "Christmas Island", "order": null }, { "code": "MO", "label": "Macao, Special Administrative Region of China", "order": null }, { "code": "HK", "label": "Hong Kong, Special Administrative Region of China", "order": null }, { "code": "CN", "label": "China", "order": null }, { "code": "CL", "label": "Chile", "order": null }, { "code": "TD", "label": "Chad", "order": null }, { "code": "CF", "label": "Central African Republic", "order": null }, { "code": "KY", "label": "Cayman Islands", "order": null }, { "code": "CV", "label": "Cape Verde", "order": null }, { "code": "CA", "label": "Canada", "order": null }, { "code": "CM", "label": "Cameroon", "order": null }, { "code": "KH", "label": "Cambodia", "order": null }, { "code": "BI", "label": "Burundi", "order": null }, { "code": "BF", "label": "Burkina Faso", "order": null }, { "code": "BG", "label": "Bulgaria", "order": null }, { "code": "BN", "label": "Brunei Darussalam", "order": null }, { "code": "IO", "label": "British Indian Ocean Territory", "order": null }, { "code": "VG", "label": "British Virgin Islands", "order": null }, { "code": "BR", "label": "Brazil", "order": null }, { "code": "BV", "label": "Bouvet Island", "order": null }, { "code": "BW", "label": "Botswana", "order": null }, { "code": "BA", "label": "Bosnia and Herzegovina", "order": null }, { "code": "BQ", "label": "Bonaire, Sint Eustatius and Saba", "order": null }, { "code": "BO", "label": "Bolivia", "order": null }, { "code": "BT", "label": "Bhutan", "order": null }, { "code": "BM", "label": "Bermuda", "order": null }, { "code": "BJ", "label": "Benin", "order": null }, { "code": "BZ", "label": "Belize", "order": null }, { "code": "BE", "label": "Belgium", "order": null }, { "code": "BY", "label": "Belarus", "order": null }, { "code": "BB", "label": "Barbados", "order": null }, { "code": "BD", "label": "Bangladesh", "order": null }, { "code": "BH", "label": "Bahrain", "order": null }, { "code": "BS", "label": "Bahamas", "order": null }, { "code": "AZ", "label": "Azerbaijan", "order": null }, { "code": "AT", "label": "Austria", "order": null }, { "code": "AU", "label": "Australia", "order": null }, { "code": "AW", "label": "Aruba", "order": null }, { "code": "AM", "label": "Armenia", "order": null }, { "code": "AR", "label": "Argentina", "order": null }, { "code": "AG", "label": "Antigua and Barbuda", "order": null }, { "code": "AQ", "label": "Antarctica", "order": null }, { "code": "AI", "label": "Anguilla", "order": null }, { "code": "AO", "label": "Angola", "order": null }, { "code": "AD", "label": "Andorra", "order": null }, { "code": "AS", "label": "American Samoa", "order": null }, { "code": "DZ", "label": "Algeria", "order": null }, { "code": "AL", "label": "Albania", "order": null }, { "code": "AX", "label": "Aland Islands", "order": null }, { "code": "AF", "label": "Afghanistan", "order": null } ], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null } ], "collection_field_type": null } }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": "#COLLECTION(allowDelete,allowInsert)", "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appellantAddressTitle", "label": "# Your client's address\nWe'll use this to work out which hearing centre is best for them.", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appellantHasFixedAddress", "label": "Does the appellant have a fixed address?", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "YesOrNo", "type": "YesOrNo", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appellantHasFixedAddressLabel", "label": "**We will use the address of your legal practice.**", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": "appellantHasFixedAddress=\"No\"", "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appellantAddress", "label": "Address", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "AddressUK", "type": "Complex", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [ { "id": "AddressLine1", "label": "Building and Street", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "TextMax150", "type": "Text", "min": null, "max": 150, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null }, { "id": "AddressLine2", "label": "Address Line 2", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "TextMax50", "type": "Text", "min": null, "max": 50, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null }, { "id": "AddressLine3", "label": "Address Line 3", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "TextMax50", "type": "Text", "min": null, "max": 50, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null }, { "id": "PostTown", "label": "Town or City", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "TextMax50", "type": "Text", "min": null, "max": 50, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null }, { "id": "County", "label": "County", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "TextMax50", "type": "Text", "min": null, "max": 50, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null }, { "id": "PostCode", "label": "Postcode/Zipcode", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "TextMax14", "type": "Text", "min": null, "max": 14, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null }, { "id": "Country", "label": "Country", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "TextMax50", "type": "Text", "min": null, "max": 50, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null } ], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": "appellantHasFixedAddress=\"Yes\"", "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appellantContactPreferenceTitle", "label": "# The appellant's contact preference\nSelect the communication method which best suits the appellant. \n\n The Tribunal needs this to: \n- provide standard guidance on the appeal process\n- update the appellant at key points in the appeal\n- send the Hearing Notice and guidance on what to expect at hearing\n- contact the appellant if, for any reason, your representation ends", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "contactPreference", "label": "Communication Preference", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "FixedRadioList-contactPreference", "type": "FixedRadioList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "wantsEmail", "label": "Email", "order": null }, { "code": "wantsSms", "label": "Text message", "order": null } ], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "email", "label": "Email address", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Email", "type": "Email", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": "contactPreference=\"wantsEmail\"", "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "mobileNumber", "label": "Mobile phone number", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "mobileNumber-c4da7253-6cc1-4789-9b63-f543ca462f0e", "type": "Text", "min": null, "max": null, "regular_expression": "^((\\+44(\\s\\(0\\)\\s|\\s0\\s|\\s)?)|0)7\\d{3}(\\s)?\\d{6}$", "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": "contactPreference=\"wantsSms\"", "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appealTypeTitle", "label": "# Type of appeal\nSelect the appeal type that best fits your case. If you want to raise something relating to another appeal type, you can do this later.", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appealType", "label": "Type of appeal", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "FixedRadioList-appealType", "type": "FixedRadioList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "refusalOfHumanRights", "label": "Refusal of a human rights claim", "order": null }, { "code": "refusalOfEu", "label": "Refusal of application under the EEA regulations", "order": null }, { "code": "deprivation", "label": "Deprivation of citizenship", "order": null }, { "code": "protection", "label": "Refusal of protection claim", "order": null }, { "code": "revocationOfProtection", "label": "Revocation of a protection status", "order": null } ], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "citizen", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appealGroundsEuRefusalTitle", "label": "# The grounds of your appeal\n\nYou'll be able to explain your grounds in more detail later.", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appealGroundsEuRefusal", "label": "The grounds of your appeal", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "appealGroundsEuRefusal", "type": "Complex", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [ { "id": "values", "label": "", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "MultiSelectList-appealGroundsEuRefusal", "type": "MultiSelectList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "appealGroundsEuRefusal", "label": "The decision breaches the appellant's rights under the EEA regulations", "order": null } ], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null } ], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appealGroundsHumanRightsRefusalTitle", "label": "# The grounds of your appeal\n\nYou'll be able to explain your grounds in more detail later.", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appealGroundsHumanRightsRefusal", "label": "The grounds of your appeal", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "appealGroundsHumanRightsRefusal", "type": "Complex", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [ { "id": "values", "label": "", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "MultiSelectList-appealGroundsHumanRightsRefusal", "type": "MultiSelectList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "protectionHumanRights", "label": "Removing the appellant from the UK would be unlawful under section 6 of the Human Rights Act 1998", "order": null } ], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null } ], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appealGroundsDeprivationTitle", "label": "# The grounds of your appeal\n\nYou'll be able to explain your grounds in more detail later.", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appealGroundsDeprivation", "label": "Select at least one of the options below", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "appealGroundsDeprivation", "type": "Complex", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [ { "id": "values", "label": "", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "MultiSelectList-appealGroundsDeprivation", "type": "MultiSelectList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "unlawfulDeprivation", "label": "The decision is unlawful because discretion should have been exercised differently", "order": null }, { "code": "disproportionateDeprivation", "label": "Deprivation would have a disproportionate effect", "order": null } ], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null } ], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appealGroundsDeprivationHumanRightsTitle", "label": "## Human rights grounds", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appealGroundsDeprivationHumanRights", "label": "Check the box if this statement also applies", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "appealGroundsHumanRights", "type": "Complex", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [ { "id": "values", "label": "", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "MultiSelectList-appealGroundsHumanRights", "type": "MultiSelectList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "protectionHumanRights", "label": "Removing the appellant from the UK would be unlawful under section 6 of the Human Rights Act 1998", "order": null } ], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null } ], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "OPTIONAL", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appealGroundsProtectionTitle", "label": "# The grounds of your appeal\n\nYou'll be able to explain your grounds in more detail later.", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appealGroundsProtection", "label": "Select at least one of the options below", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "appealGroundsProtection", "type": "Complex", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [ { "id": "values", "label": "", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "MultiSelectList-appealGroundsProtection", "type": "MultiSelectList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "protectionRefugeeConvention", "label": "Removing the appellant from the UK would breach the UK's obligation under the Refugee Convention", "order": null }, { "code": "protectionHumanitarianProtection", "label": "Removing the appellant from the UK would breach the UK's obligation in relation to persons eligible for a grant of humanitarian protection", "order": null } ], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null } ], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appealGroundsProtectionHumanRightsTitle", "label": "## Human rights grounds", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appealGroundsHumanRights", "label": "Check the box if this statement also applies", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "appealGroundsHumanRights", "type": "Complex", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [ { "id": "values", "label": "", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "MultiSelectList-appealGroundsHumanRights", "type": "MultiSelectList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "protectionHumanRights", "label": "Removing the appellant from the UK would be unlawful under section 6 of the Human Rights Act 1998", "order": null } ], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null } ], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "OPTIONAL", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appealGroundsRevocationTitle", "label": "# The grounds of your appeal\n\nYou'll be able to explain your grounds later.", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "appealGroundsRevocation", "label": "Select at least one of the options below", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "appealGroundsRevocation", "type": "Complex", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [ { "id": "values", "label": "", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "MultiSelectList-appealGroundsRevocation", "type": "MultiSelectList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "revocationRefugeeConvention", "label": "Revocation of the appellant's protection status breaches the United Kingdom's obligations under the Refugee Convention", "order": null }, { "code": "revocationHumanitarianProtection", "label": "Revocation of the appellant's protection status breaches the United Kingdom's obligations in relation to persons eligible for humanitarian protection", "order": null } ], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null } ], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "newMattersTitle", "label": "# New matters", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "hasNewMatters", "label": "Are there any new reasons your client wishes to remain in the UK or any new grounds on which they should be permitted to stay?", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "YesOrNo", "type": "YesOrNo", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "newMatters", "label": "Explain these new matters and their relevance to the appeal", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "TextArea", "type": "TextArea", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": "hasNewMatters=\"Yes\"", "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "hasOtherAppealsTitle", "label": "# Has your client appealed against any other UK immigration decisions?", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "hasOtherAppeals", "label": "Other appeals", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "FixedList-otherAppeals", "type": "FixedList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "NotSure", "label": "I'm not sure", "order": null }, { "code": "No", "label": "No", "order": null }, { "code": "YesWithoutAppealNumber", "label": "Yes, but I don't have an appeal number", "order": null }, { "code": "Yes", "label": "Yes", "order": null } ], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "otherAppealsTitle", "label": "# Has your client appealed against any other UK immigration decisions?", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "otherAppeals", "label": "Appeal number", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "otherAppeals-19fa7c04-10e6-4336-b620-97acf30d2548", "type": "Collection", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": { "id": "appealNumber", "type": "Complex", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [ { "id": "value", "label": "", "hidden": null, "order": null, "metadata": false, "case_type_id": null, "hint_text": null, "field_type": { "id": "value-51dcbc6f-e43e-4efc-81ae-a1dec1c2dcb7", "type": "Text", "min": null, "max": null, "regular_expression": "^(RP|PA|EA|HU|DC|DA|AA|IA|OA|VA)\\/[0-9]{5}\\/[0-9]{4}$", "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "security_classification": "PUBLIC", "live_from": null, "live_until": null, "show_condition": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ], "complexACLs": [], "display_context": null, "display_context_parameter": null, "formatted_value": null } ], "collection_field_type": null } }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": "#COLLECTION(allowDelete,allowInsert)", "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "legalRepDetailsHintAndTitle", "label": "# Legal representative details\nEnter your details.", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "legalRepCompany", "label": "Company", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Text", "type": "Text", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "legalRepName", "label": "Name", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Text", "type": "Text", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "legalRepReferenceNumber", "label": "Own reference", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Text", "type": "Text", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-caseofficer", "create": true, "read": true, "update": true, "delete": true }, { "role": "caseworker-ia-admofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficeapc", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficelart", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-homeofficepou", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-respondentofficer", "create": false, "read": true, "update": false, "delete": false }, { "role": "caseworker-ia-iacjudge", "create": false, "read": true, "update": false, "delete": false } ] }, { "id": "isFeePaymentEnabled", "label": "isFeePaymentEnabled", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Text", "type": "Text", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": "legalRepReferenceNumber=\"DUMMY_VALUE_TO_HIDE_FIELD\"", "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true } ] }, { "id": "decisionHearingFeeOption", "label": "How do you want the appeal to be decided?", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "FixedRadioList-decisionHearingFeeOption", "type": "FixedRadioList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "decisionWithHearing", "label": "Decision with a hearing. The fee for this type of appeal is £140", "order": null }, { "code": "decisionWithoutHearing", "label": "Decision without a hearing. The fee for this type of appeal is £80", "order": null } ], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true } ] }, { "id": "makePayment", "label": "# Make a payment", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Label", "type": "Label", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true } ] }, { "id": "payForTheAppealOption", "label": "When will you pay?", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "FixedRadioList-paymentPreference", "type": "FixedRadioList", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [ { "code": "payLater", "label": "Submit the appeal now and pay within 14 days", "order": null }, { "code": "payNow", "label": "Pay and submit the appeal now", "order": null } ], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "MANDATORY", "display_context_parameter": null, "show_condition": null, "show_summary_change_option": true, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true } ] }, { "id": "appealFeeHearingDesc", "label": "", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Text", "type": "Text", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": "decisionHearingFeeOption=\"decisionWithHearing\"", "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true } ] }, { "id": "appealFeeWithoutHearingDesc", "label": "", "hidden": null, "value": null, "metadata": false, "hint_text": null, "field_type": { "id": "Text", "type": "Text", "min": null, "max": null, "regular_expression": null, "fixed_list_items": [], "complex_fields": [], "collection_field_type": null }, "validation_expr": null, "security_label": "PUBLIC", "order": null, "formatted_value": null, "display_context": "READONLY", "display_context_parameter": null, "show_condition": "decisionHearingFeeOption=\"decisionWithoutHearing\"", "show_summary_change_option": false, "show_summary_content_option": null, "acls": [ { "role": "caseworker-ia-legalrep-solicitor", "create": true, "read": true, "update": true, "delete": true } ] } ], "event_token": "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJnOHQwZWM2NmI0NnE4b2libmJncHIzOGdrbSIsInN1YiI6IjQxYTkwYzM5LWQ3NTYtNGViYS04ZTg1LTViNWJmNTZiMzFmNSIsImlhdCI6MTU5NjU0OTI3NSwiZXZlbnQtaWQiOiJzdGFydEFwcGVhbCIsImNhc2UtdHlwZS1pZCI6IkFzeWx1bSIsImp1cmlzZGljdGlvbi1pZCI6IklBIiwiY2FzZS12ZXJzaW9uIjoiYmYyMWE5ZThmYmM1YTM4NDZmYjA1YjRmYTA4NTllMDkxN2IyMjAyZiJ9.Se_jKUNpOUU9p6VUZsu8Ok9flYDv0tMMoGZrhEnmqt0", "wizard_pages": [ { "id": "startAppealchecklist", "label": null, "order": 1, "wizard_page_fields": [ { "case_field_id": "checklistTitle", "order": 2, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "checklistTitle2", "order": 1, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "checklist", "order": 3, "page_column_no": null, "complex_field_overrides": [] } ], "show_condition": null, "callback_url_mid_event": null, "retries_timeout_mid_event": [] }, { "id": "startAppealhomeOfficeDecision", "label": null, "order": 2, "wizard_page_fields": [ { "case_field_id": "homeOfficeDecisionTitle", "order": 1, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "homeOfficeReferenceNumber", "order": 2, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "homeOfficeDecisionLetterImage", "order": 3, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "homeOfficeDecisionDate", "order": 4, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "homeOfficeDecisionEnvelopeImage", "order": 5, "page_column_no": null, "complex_field_overrides": [] } ], "show_condition": null, "callback_url_mid_event": null, "retries_timeout_mid_event": [] }, { "id": "startAppealappellantBasicDetails", "label": null, "order": 3, "wizard_page_fields": [ { "case_field_id": "appellantBasicDetailsTitle", "order": 1, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appellantTitle", "order": 2, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appellantGivenNames", "order": 3, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appellantFamilyName", "order": 4, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appellantDateOfBirth", "order": 5, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appellantNationalities", "order": 6, "page_column_no": null, "complex_field_overrides": [] } ], "show_condition": null, "callback_url_mid_event": null, "retries_timeout_mid_event": [] }, { "id": "startAppealappellantAddress", "label": null, "order": 4, "wizard_page_fields": [ { "case_field_id": "appellantAddressTitle", "order": 1, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appellantHasFixedAddress", "order": 2, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appellantHasFixedAddressLabel", "order": 3, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appellantAddress", "order": 4, "page_column_no": null, "complex_field_overrides": [] } ], "show_condition": null, "callback_url_mid_event": null, "retries_timeout_mid_event": [] }, { "id": "startAppealappellantContactPreference", "label": null, "order": 5, "wizard_page_fields": [ { "case_field_id": "appellantContactPreferenceTitle", "order": 1, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "contactPreference", "order": 2, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "email", "order": 3, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "mobileNumber", "order": 4, "page_column_no": null, "complex_field_overrides": [] } ], "show_condition": null, "callback_url_mid_event": null, "retries_timeout_mid_event": [] }, { "id": "startAppealappealType", "label": null, "order": 6, "wizard_page_fields": [ { "case_field_id": "appealTypeTitle", "order": 1, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appealType", "order": 2, "page_column_no": null, "complex_field_overrides": [] } ], "show_condition": null, "callback_url_mid_event": null, "retries_timeout_mid_event": [] }, { "id": "startAppealappealGroundsEuRefusal", "label": null, "order": 7, "wizard_page_fields": [ { "case_field_id": "appealGroundsEuRefusalTitle", "order": 1, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appealGroundsEuRefusal", "order": 2, "page_column_no": null, "complex_field_overrides": [] } ], "show_condition": "appealType=\"refusalOfEu\"", "callback_url_mid_event": null, "retries_timeout_mid_event": [] }, { "id": "startAppealappealGroundsHumanRightsRefusal", "label": null, "order": 8, "wizard_page_fields": [ { "case_field_id": "appealGroundsHumanRightsRefusalTitle", "order": 1, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appealGroundsHumanRightsRefusal", "order": 2, "page_column_no": null, "complex_field_overrides": [] } ], "show_condition": "appealType=\"refusalOfHumanRights\"", "callback_url_mid_event": null, "retries_timeout_mid_event": [] }, { "id": "startAppealappealGroundsDeprivation", "label": null, "order": 9, "wizard_page_fields": [ { "case_field_id": "appealGroundsDeprivationTitle", "order": 1, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appealGroundsDeprivation", "order": 2, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appealGroundsDeprivationHumanRightsTitle", "order": 3, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appealGroundsDeprivationHumanRights", "order": 4, "page_column_no": null, "complex_field_overrides": [] } ], "show_condition": "appealType=\"deprivation\"", "callback_url_mid_event": null, "retries_timeout_mid_event": [] }, { "id": "startAppealappealGroundsProtection", "label": null, "order": 10, "wizard_page_fields": [ { "case_field_id": "appealGroundsProtectionTitle", "order": 1, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appealGroundsProtection", "order": 2, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appealGroundsProtectionHumanRightsTitle", "order": 3, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appealGroundsHumanRights", "order": 4, "page_column_no": null, "complex_field_overrides": [] } ], "show_condition": "appealType=\"protection\"", "callback_url_mid_event": null, "retries_timeout_mid_event": [] }, { "id": "startAppealappealGroundsRevocation", "label": null, "order": 11, "wizard_page_fields": [ { "case_field_id": "appealGroundsRevocationTitle", "order": 1, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appealGroundsRevocation", "order": 2, "page_column_no": null, "complex_field_overrides": [] } ], "show_condition": "appealType=\"revocationOfProtection\"", "callback_url_mid_event": null, "retries_timeout_mid_event": [] }, { "id": "startAppealnewMatters", "label": null, "order": 12, "wizard_page_fields": [ { "case_field_id": "newMattersTitle", "order": 1, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "hasNewMatters", "order": 2, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "newMatters", "order": 3, "page_column_no": null, "complex_field_overrides": [] } ], "show_condition": null, "callback_url_mid_event": null, "retries_timeout_mid_event": [] }, { "id": "startAppealhasOtherAppeals", "label": null, "order": 13, "wizard_page_fields": [ { "case_field_id": "hasOtherAppealsTitle", "order": 1, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "hasOtherAppeals", "order": 2, "page_column_no": null, "complex_field_overrides": [] } ], "show_condition": null, "callback_url_mid_event": null, "retries_timeout_mid_event": [] }, { "id": "startAppealotherAppeals", "label": null, "order": 14, "wizard_page_fields": [ { "case_field_id": "otherAppealsTitle", "order": 1, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "otherAppeals", "order": 2, "page_column_no": null, "complex_field_overrides": [] } ], "show_condition": "hasOtherAppeals=\"Yes\"", "callback_url_mid_event": null, "retries_timeout_mid_event": [] }, { "id": "startAppeallegalRepresentativeDetails", "label": null, "order": 15, "wizard_page_fields": [ { "case_field_id": "legalRepDetailsHintAndTitle", "order": 1, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "legalRepCompany", "order": 2, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "legalRepName", "order": 3, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "legalRepReferenceNumber", "order": 4, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "isFeePaymentEnabled", "order": 5, "page_column_no": null, "complex_field_overrides": [] } ], "show_condition": null, "callback_url_mid_event": null, "retries_timeout_mid_event": [] }, { "id": "startAppealhearingFeeDecision", "label": null, "order": 16, "wizard_page_fields": [ { "case_field_id": "decisionHearingFeeOption", "order": 1, "page_column_no": null, "complex_field_overrides": [] } ], "show_condition": "isFeePaymentEnabled=\"Yes\" AND appealType!=\"deprivation\" AND appealType!=\"revocationOfProtection\"", "callback_url_mid_event": null, "retries_timeout_mid_event": [] }, { "id": "startAppealpayment", "label": null, "order": 17, "wizard_page_fields": [ { "case_field_id": "makePayment", "order": 1, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "payForTheAppealOption", "order": 6, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appealFeeHearingDesc", "order": 4, "page_column_no": null, "complex_field_overrides": [] }, { "case_field_id": "appealFeeWithoutHearingDesc", "order": 5, "page_column_no": null, "complex_field_overrides": [] } ], "show_condition": "isFeePaymentEnabled=\"Yes\" AND appealType!=\"deprivation\" AND appealType!=\"revocationOfProtection\"", "callback_url_mid_event": null, "retries_timeout_mid_event": [] } ], "show_summary": true, "show_event_notes": false, "end_button_label": "Save and continue", "can_save_draft": null, "_links": { "self": { "href": "http://gateway-ccd.aat.platform.hmcts.net/internal/case-types/Asylum/event-triggers/startAppeal?ignore-warning=false" } } }
const Homework = require('../models/homework') const mysql = require('mysql') const mysqlOption = require('../config/db') const conn = mysql.createConnection(mysqlOption.mysql) const sqlMap = require('../dao/sqlMap') class HomeworkRepository { constructor(){ } listStuHomework(params, callback){ conn.query(sqlMap.loginUser, [params.username], function(err, result){ if(err) throw err callback(JSON.parse(JSON.stringify(result))) }) } findStuHomeworkBy(id, callback) { conn.query(sqlMap.homeworkStu, [id], function(err, result){ if(err) throw err callback(JSON.parse(JSON.stringify(result))) }) } specStuHomework(params, callback) { conn.query(sqlMap.specHw, [params.hwID, params.stuID], function(err, result){ //console.log(JSON.parse(JSON.stringify(result))) if(err) throw err callback(JSON.parse(JSON.stringify(result))) }) } createScore(params,callback){ conn.query(sqlMap.createScore,[params.hwID,params.stuID],function(err,result){ if(err) throw err callback(JSON.parse(JSON.stringify(result))) }) } updateScoreFile(params) { conn.query(sqlMap.updateScoreFile, [params.fileInfo, params.hwID, params.stuID], function(err, result){ if(err) throw err }) } updateScore(params,callback){ conn.query(sqlMap.updateScore, [params.state,params.score,params.comments,params.resultFile, params.hwID,params.stuID],function(err,result){ if(err) throw err callback(JSON.parse(JSON.stringify(result))) }) } updateScoreResultFile(params,callback){ conn.query(sqlMap.updateScoreResultFile,[params.resultFilename,params.hwID,params.stuID],function(err,result){ if(err) throw err callback(JSON.parse(JSON.stringify(result))) }) } deleteUsersBy(id) { } } module.exports = new HomeworkRepository()
module.exports = { /* Return date string with has offset calculated from UTC, i.e. Thu Sep 24 2015 10:29:25 GMT-0700 (PDT) with offset -7 would give 2015-09-24T10:29 */ convertISOToLocalTruncatedMinutes: function (dateInMillis, hourOffset) { function pad(number) { if (number < 10) { return '0' + number; } return number; } //console.log("Date: " + new Date(dateInMillis).toISOString()); var shiftedDateMillis = dateInMillis + (hourOffset * 60 * 60 * 1000); var shiftedDate = new Date(shiftedDateMillis); return shiftedDate.getUTCFullYear() + '-' + pad(shiftedDate.getUTCMonth() + 1) + '-' + pad(shiftedDate.getUTCDate()) + 'T' + pad(shiftedDate.getUTCHours()) + ':' + pad(shiftedDate.getUTCMinutes()); } }
import React from 'react'; import styled from 'styled-components'; import { darken } from 'polished'; import StockLabel from '../../../../components/StockLabel'; import Input from '../../../../components/Input'; import Button from '../../../../components/Button'; import Title from '../../../../components/Title'; import Label from '../../../../components/Label'; const Wrapper = styled.div` flex: 1 1 40%; padding: 2rem; background-color: ${({ theme }) => theme.base}; `; const Name = styled(Title)` margin: 0 0 0.3rem; font-size: 1.8rem; `; const Price = styled.span` display: block; margin-top: 1.5rem; color: ${({ theme }) => theme.primary}; font-size: 1.5rem; `; const QuantityWrapper = styled.div` margin: 1.5rem 0 1rem; `; const QuantityLabel = styled(Label)` margin-bottom: 5px; font-size: 0.75rem; font-weight: 300; text-transform: capitalize; `; const Quantity = styled.div` display: flex; align-items: center; `; const QuantityInput = styled(Input).attrs({ type: 'number', defaultValue: 1, min: 1 })` width: 3.3rem; padding: 0.5rem 0 0.5rem 0.6rem; margin-right: 1rem; border: 0; outline: 0; color: ${({ theme }) => darken(0.5, theme.grayLighter)}; `; const ShopIcon = styled.i.attrs({ className: 'fa fa-shopping-cart' })` margin: -1px 0.5rem 0 0; font-size: 1rem; `; const AddToCartSection = () => ( <Wrapper> <Name>HP LaserJet PRO 100</Name> <StockLabel withStock /> <Price>$ 599.00</Price> <QuantityWrapper> <QuantityLabel>Cantidad:</QuantityLabel> <Quantity> <QuantityInput /> <Button to="/carrito"><ShopIcon />Agregar al carrito</Button> </Quantity> </QuantityWrapper> <Button to="/carrito" primary>Comprar</Button> </Wrapper> ); export default AddToCartSection;
const embed = require("../embedCreator"); module.exports = async function setUser(Osu, Discord, msg, msgargs, db) { var sendstr = new embed(); var osuUserName = msgargs[0]; //msgargs are seperated by ' ' so 0th arg should be name. if (msgargs.length === 0) { //Username to set not Specified. sendstr.withTitle("Username Confirmation"); sendstr.withDesc("You have not set a user to be tracked."); Discord.createMessage(msg.channel.id, sendstr); } else { db.find({ discordID: msg.author.id }, //If there's no error, do this: (err, docs) => { if (err) console.log(err); else if (docs.length > 0) { //Name has been set already, remap to a new name. db.update({ //Search by discordID because the users are rarted. discordID: msg.author.id }, { $set: { //Set these feilds only. Do not change anything else. OsuID: osuUserName } }); sendstr.withTitle("Username Confirmation"); sendstr.withDesc(`Your username has been set as ${osuUserName}`); Discord.createMessage(msg.channel.id, sendstr); } else { //TODO: /**Add additional feilds when inserting the player information. * Implement secondary DB data fetch (One for the Player Data so that it can be stored locally)(needed?); */ sendstr.withTitle("Username Confirmation"); sendstr.withDesc(`Your username has been set as ${osuUserName}`); Discord.createMessage(msg.channel.id, sendstr); db.insert({ discordID: msg.author.id, OsuID: osuUserName }); //DB now has been inserted to. ERROR check is not done. TODO. } } ); } };
module.exports = (app) => { const getById = (req, res) => { app.services.accounts.findById({id: req.params.id}) .then((result) => { if(!result) { return res.status(400).json(`Conta de id ${req.params.id} não encontrado!`) } return res.status(200).json(result); }) } const getAll = (req, res) => { app.services.accounts.findAll() .then(result => res.status(200).json(result)); } const create = (req, res, next) => { app.services.accounts.save(req.body) .then((result) => { return res.status(201).json(result[0]); }) .catch(err => next(err)); } const update = (req, res) => { app.services.accounts.update(req.params.id, req.body) .then(result => res.status(200).json(result[0])); } const deleteAccounts = (req, res) => { app.services.accounts.deleteAccounts(req.params.id) .then(() => res.status(204).send()); } return { create, getAll, getById, update, deleteAccounts }; };
import { useDispatch, useSelector } from "react-redux"; import * as d3 from "d3"; import slice from "../slice.js"; import { Responsive } from "./Responsive.js"; function TimelineChart({ width, height }) { const dispatch = useDispatch(); const topics = useSelector(({ topics }) => topics); const words = useSelector(({ words }) => words); const dailyCount = useSelector(({ dailyCount }) => dailyCount); const selectedTopics = useSelector(({ topics, selectedTopics }) => selectedTopics.map((id) => topics[id]), ); const selectedWords = useSelector( ({ selectedWords }) => new Set(selectedWords), ); const minWordCount = useSelector(({ minWordCount }) => minWordCount); const discoverTopic = useSelector(({ discoverTopic }) => discoverTopic); const margin = { top: 20, right: 60, bottom: 50, left: 60, }; const contentWidth = width - margin.left - margin.right; const contentHeight = height - margin.top - margin.bottom; const axisColor = "#363636"; const barWidth = contentWidth / dailyCount.length + 1; const timeFormat = d3.timeFormat("%Y-%m-%d"); const xScale = d3 .scaleTime() .domain(d3.extent(dailyCount, (item) => new Date(item.time))) .range([barWidth / 2, contentWidth - barWidth / 2]); const barHeightScale = d3 .scaleLinear() .domain([0, d3.max(dailyCount, (item) => item.tweetCount)]) .range([0, contentHeight]) .nice(); const lineYScale = d3 .scaleLinear() .domain([ 0, d3.max(dailyCount, (item) => { if (selectedWords.size === 0) { return 100; } return d3.max(Array.from(selectedWords), (id) => item.words[id]); }), ]) .range([contentHeight, 0]) .nice(); return ( <svg width={width} height={height}> <g transform={`translate(${margin.left},${margin.top})`}> <g> {dailyCount.map((item, i) => { const t1 = new Date(item.time); const t2 = new Date(t1.getTime() + 86400000); const active = selectedTopics.length === 0 || selectedTopics.some((topic) => { const start = new Date(topic.time); const stop = new Date(topic.stopTime); return t1 <= stop && start <= t2; }); return ( <g key={item.time} style={{ transitionProperty: "opacity", transitionDuration: "1s", transitionTimingFunction: "ease", }} opacity={active ? 1 : 0.1} > <title>{timeFormat(t1)}</title> <rect className="is-clickable" x={xScale(new Date(item.time)) - barWidth / 2} y={contentHeight - barHeightScale(item.tweetCount)} width={barWidth} height={barHeightScale(item.tweetCount)} fill={item.color} onClick={() => { if (selectedTopics.length !== 0 && active) { dispatch(slice.actions.selectTopics([])); } else { dispatch( slice.actions.selectTopics( topics .filter((topic) => { const start = new Date(topic.time); const stop = new Date(topic.stopTime); return t1 <= stop && start <= t2; }) .map(({ id }) => id), ), ); } }} /> </g> ); })} </g> <g> {words.map((word) => { const line = d3.line().x((item) => xScale(new Date(item.time))); if (selectedWords.has(word.id)) { line.y((item) => lineYScale(item.words[word.id])); } else { line.y(() => lineYScale(0)); } return ( <g key={word.id} className="is-clickable" onClick={() => { dispatch(slice.actions.toggleWord(word.id)); if (discoverTopic) { const sWords = Array.from(selectedWords); const index = sWords.indexOf(word.id); if (index < 0) { sWords.push(word.id); } else { sWords.splice(index, 1); } if (sWords.size === 0) { dispatch(slice.actions.selectTopics([])); } else { dispatch( slice.actions.selectTopics( topics .filter((topic) => { const topicId = topic.id; var flag = 0; sWords.forEach(function (element) { if ( words[element].topicCount[topicId] < minWordCount ) flag = 1; }); return flag === 0; }) .map(({ id }) => id), ), ); } } }} > <path style={{ transitionPropery: "d", transitionDuration: "1s", transitionTimingFunction: "ease", }} d={line(dailyCount)} fill="none" opacity="0.9" stroke={selectedWords.has(word.id) ? word.color : "none"} strokeWidth="5" > <title>{word.word}</title> </path> </g> ); })} </g> <g> {words.map((word) => { if (!selectedWords.has(word.id)) { return null; } const maxIndex = dailyCount.reduce( (x, item, i) => item.words[word.id] > dailyCount[x].words[word.id] ? i : x, 0, ); const maxItem = dailyCount[maxIndex]; return ( <g key={word.id} className="is-clickable" onClick={() => { dispatch(slice.actions.toggleWord(word.id)); const sWords = Array.from(selectedWords); const index = sWords.indexOf(word.id); if (index < 0) { sWords.push(word.id); } else { sWords.splice(index, 1); } if (sWords.size === 0) { dispatch(slice.actions.selectTopics([])); } else { dispatch( slice.actions.selectTopics( topics .filter((topic) => { const topicId = topic.id; var flag = 0; sWords.forEach(function (element) { if ( words[element].topicCount[topicId] < minWordCount ) flag = 1; }); return flag === 0; }) .map(({ id }) => id), ), ); } }} > <text x={xScale(new Date(maxItem.time))} y={lineYScale(maxItem.words[word.id])} textAnchor="middle" dominantBaseline="text-after-edge" fontWeight="700" fontSize="12" fill={axisColor} > {word.word} </text> </g> ); })} </g> <g transform={`translate(0,${contentHeight})`}> <line x1="0" y1="0" x2={contentWidth} y2="0" stroke={axisColor} /> <g> {xScale.ticks().map((x, i) => { return ( <g key={i} transform={`translate(${xScale(x)},0)`}> <line x1="0" y1="0" x2="0" y2="5" stroke={axisColor} /> <g transform="rotate(-30)"> <text x="-5" textAnchor="end" dominantBaseline="text-before-edge" fontWeight="700" fontSize="10" fill={axisColor} > {timeFormat(x)} </text> </g> </g> ); })} </g> </g> <g> <text transform={`translate(-50,${contentHeight / 2})rotate(-90)`} textAnchor="middle" dominantBaseline="central" fontWeight="700" fontSize="16" fill={axisColor} > Tweet Count </text> <line x1="0" y1={contentHeight} x2="0" y2="0" stroke={axisColor} /> <g> {barHeightScale.ticks().map((y, i) => { return ( <g key={i} transform={`translate(0,${ contentHeight - barHeightScale(y) })`} > <line x1="0" y1="0" x2="-5" y2="0" stroke={axisColor} /> <text x="-7" textAnchor="end" dominantBaseline="central" fontWeight="700" fontSize="12" fill={axisColor} > {y} </text> </g> ); })} </g> </g> <g transform={`translate(${contentWidth},0)`}> <text transform={`translate(40,${contentHeight / 2})rotate(-90)`} textAnchor="middle" dominantBaseline="central" fontWeight="700" fontSize="16" fill={axisColor} > Word Occurrence </text> <line x1="0" y1={contentHeight} x2="0" y2="0" stroke={axisColor} /> <g> {lineYScale.ticks().map((y, i) => { return ( <g key={i} transform={`translate(0,${lineYScale(y)})`}> <line x1="0" y1="0" x2="5" y2="0" stroke={axisColor} /> <text x="7" textAnchor="start" dominantBaseline="central" fontWeight="700" fontSize="12" fill={axisColor} > {y} </text> </g> ); })} </g> </g> </g> </svg> ); } export function TimelineView() { return ( <Responsive render={(width, height) => ( <TimelineChart width={width} height={height} /> )} /> ); }
/* Slice: it takes portion of an array to create a new array without deleting elements from the parent array it takes stating index and the end index as parameter, where the difference between the index will return the number of elements from parent array. The return type or output will be a array or list. Syntax: arr.slice(start index, last index) // op: [no of elements(diffrence of start and end index) starting from start index ] ______**********_______________________________***********____________________________*********___________________________ Splice: it pops out/delete no of elements from parent element hence alter/update the parent arrry. it takes start index and count of elements to be deleted starting from start index. The return type or output will be a array or list. syntax: arr.splice(start index, count of elements to be deleted from start index); split: it actually splits a string based on a perticular character or string including space, and special characters. It's operates on strings only.The return type or output will be a array or list. */ // array slice() ------------------- var a = [1,2,3,4,5,6] var b = a.slice(2,4)// op: [3,4] console.log('value of a', a) //[1,2,3,4,5,6] console.log('value of b', b) //[3,4] var b = a.slice(2,6)// op: [3,4,5,6] = a.slice(2, any value more than last index of array) console.log('value of a', a) //[1,2,3,4,5,6] console.log('value of b', b) //[3,4] var b = a.slice(2,1202) // it wont throw error, however max possible element to be fetched from arry console.log('value of b', b) //[3,4,5,6] // array split() ------------------- var a = [1,2,3,4,5,6] var b = a.splice(2,2); console.log('value of a', a) //[1,2,5,6] console.log('value of b', b) //[3,4] var b = a.splice(2,4); console.log('value of a', a) //[1,2] console.log('value of b', b) //[3,4,5,6] =a.splice(2, any value more than last index of array) var a = [1,2,3,4,5,6] var b = a.splice(2,4200); console.log('value of a', a) //[1,2] console.log('value of b', b) //[3,4,5,6] =a.splice(2, any value more than last index of array) ____________________**************_______________________ //String Split() ---------------- var a = 'hellohello'; var b = a.split('o'); console.log('value of a', a) //'hellohello' console.log('value of b', b) // [ 'hell', 'hell', '' ] var b = a.split('h'); console.log('value of b', b) //[ '', 'ello', 'ello' ] var b = a.split('l'); console.log('value of b', b) //[ 'he', '', 'ohe', '', 'o' ] var b = a.split('ll'); console.log('value of b', b) //[ 'he', ohe', 'o' ]
import React from 'react'; import PropTypes from 'prop-types'; import { Grid, Col, Row, Panel, Image } from 'react-bootstrap'; const isSearched = searchTerm => person => person.name.first.toLowerCase().includes(searchTerm.toLowerCase()) || person.name.last.toLowerCase().includes(searchTerm.toLowerCase()); const Contacts = ({ list, pattern }) => ( <div className="Contacts"> <Grid> <Row className="show-Grid"> {list.filter(isSearched(pattern)).map(person => ( <Col key={person.email} sm={6} md={3}> <Panel bsStyle="primary"> <Panel.Heading> <Panel.Title componentClass="h3"> {person.name.first} {person.name.last} </Panel.Title> </Panel.Heading> <Panel.Body> <Image src={person.picture.large} circle /> <p> <br/> <a href={`mailto: ${person.email}`} target="_blank">{person.email}</a> </p> <p><a href={`tel:+${person.phone}`} target="_blank">{person.phone}</a></p> </Panel.Body> <Panel.Footer> <a href={`http://twitter.com/${person.login.username}`} target="_blank">@{person.login.username}</a></Panel.Footer> </Panel> </Col> ))} </Row> </Grid> </div> ); Contacts.propTypes = { list: PropTypes.arrayOf( PropTypes.shape({ email: PropTypes.string.isRequired, name: PropTypes.object.isRequired, phone: PropTypes.string.isRequired, picture: PropTypes.object.isRequired, login: PropTypes.object.isRequired }) ) } export default Contacts;
import { Header } from "./components"; import { Routes, Route } from "react-router-dom"; import { Home, Blogs, Projects, Others } from "./pages"; function App() { return ( <div className="w-screen"> <Header /> <div className="w-11/12 sm:10/12 md:w-9/12 lg:w-8/12 mx-auto"> <Routes> <Route path="/" element={<Home />} /> <Route path="/blogs" element={<Blogs />} /> <Route path="/projects" element={<Projects />} /> <Route path="/others" element={<Others />} /> </Routes> </div> </div> ); } export default App;
import RestfulDomainModel from '../base/RestfulDomainModel' class Model extends RestfulDomainModel { async syncTenant() { return await this.post(`${this.baseUrl}/syncTenant`, {}) } async syncVirtualDevice() { return await this.post(`${this.baseUrl}/syncVirtualDevice`, {}) } } export default new Model([], '/tenant/tenant')
import chalk from 'chalk' import FileHelper from '../helper/fileHelper.js' import DbHelper from '../loadDatabase/dbHelper.js' import inetHelper from '../helper/inetHelper.js' import DateHelper from '../helper/dateHelper.js' import Log from '../helper/logHelper.js' if (FileHelper.isFileExists('load.log')) { FileHelper.deleteFile('load.log') } const log = Log.create('load.log') import XlsGoogleParserChronos from './xlsGoogleParserChronos.js' import XlsGoogleParserAgreements from './xlsGoogleParserAgreements.js' import XlsGoogleParserBattles from './xlsGoogleParserBattles.js' import XlsGoogleParserPersons from './xlsGoogleParserPersons.js' import FileParserPersons from './fileParserPersons.js' log.success(chalk.greenBright(`Запуск процесса загрузки ${DateHelper.nowToStr()}`)) const checkedCoordsPath = 'loadDatabase\\dataSources\\checkedCoords.json' inetHelper.loadCoords(checkedCoordsPath) const dbHelper = new DbHelper() const xlsGoogleParserChronos = new XlsGoogleParserChronos(log) const xlsGoogleParserAgreements = new XlsGoogleParserAgreements(log) const wowSheetId = process.env.GOOGLE_SHEET_ID_BATTLES const xlsGoogleParserBattles = new XlsGoogleParserBattles(log, wowSheetId, 'wow') const wmwSheetId = process.env.GOOGLE_SHEET_ID_BATTLES_WMW const xlsGoogleParserBattlesWMW = new XlsGoogleParserBattles(log, wmwSheetId, 'wmw') const xlsGoogleParserPersons = new XlsGoogleParserPersons(log) const fileParserPersons = new FileParserPersons(log, './public/data/persons.json') Promise.resolve(true) .then(() => { return dbHelper.connect() }) // .then(() => { // return xlsGoogleParserChronos.processData(dbHelper) // }) // .then(() => { // return xlsGoogleParserAgreements.processData(dbHelper) // }) .then(() => { return xlsGoogleParserBattles.processData(dbHelper, true) }) .then(() => { return xlsGoogleParserBattlesWMW.processData(dbHelper, false) }) .then(() => { return xlsGoogleParserPersons.processData(dbHelper) }) // .then(() => { // return fileParserPersons.processData(dbHelper) // }) .then(() => { log.success(chalk.greenBright(`Окончание процесса загрузки ${DateHelper.nowToStr()}`)) dbHelper.free() inetHelper.saveCoords(checkedCoordsPath) }) .catch((err) => { dbHelper.free() inetHelper.saveCoords(checkedCoordsPath) log.error(`Ошибка загрузки данных: ${err}`) })
/** * @author Ignacio González Bullón - <nacho.gonzalez.bullon@gmail.com> * @since 21/12/15. */ (function () { 'use strict'; angular.module('corestudioApp.admin') .controller('PassTypeController', PassTypeController); PassTypeController.$inject = ['PassType', 'Alerts', '$uibModal']; function PassTypeController(PassType, Alerts, $uibModal) { var vm = this; vm.data = []; vm.search = search; vm.openModal = openModal; vm.deletePassType = deletePassType; function search(tableState) { var pagination = tableState.pagination; var pageRequest = {}; pageRequest.page = pagination.start ? Math.floor((pagination.start + 1) / pagination.number) : 0; pageRequest.size = pagination.number || 10; pageRequest.sortBy = tableState.sort.predicate || 'activity.name'; pageRequest.direction = tableState.sort.reverse ? 'DESC' : 'ASC'; PassType.query(pageRequest, function (responseData) { vm.data = responseData.content; tableState.pagination.numberOfPages = responseData.totalPages; }); } function openModal(passType) { var modalInstance = $uibModal.open({ templateUrl: 'scripts/app/admin/passType/admin.passType.modal.html', size: 'sm', controller: 'PassTypeModalController', controllerAs: 'modal', resolve: { passType: function () { return angular.copy(passType); } } }); modalInstance.result.then(function (result) { switch (result.action) { case 'SAVE': createPassType(result.passType); break; case 'UPDATE': updatePassType(result.passType, vm.data.indexOf(passType)); break; default: break; } }); } function createPassType(passType) { PassType.save(passType, function (data, headers) { vm.data.push(data); Alerts.addHeaderSuccessAlert(headers()); }, function (response) { Alerts.addHeaderErrorAlert(response.headers()); }); } function updatePassType(passType, index) { PassType.update(passType, function (data, headers) { vm.data[index] = data; vm.displayData = [].concat(vm.data); Alerts.addHeaderSuccessAlert(headers()); }, function (response) { Alerts.addHeaderErrorAlert(response.headers()); }); } function deletePassType(passType) { var modalInstance = $uibModal.open({ templateUrl: 'scripts/components/modals/confirmModal.html', size: 'sm', controller: 'ConfirmModalController', controllerAs: 'modal', resolve: { title: function () { return 'Eliminar tipo de abono'; }, message: function () { return 'Está seguro de que desea eliminar el abono ' + passType.activity.name + ' ' + passType.numberOfSessions + ' sesiones?'; } } }); modalInstance.result.then(function (result) { if(result === 'OK') { var index = vm.data.indexOf(passType); PassType.delete({id: passType.id}, function (data, headers) { vm.data.splice(index, 1); Alerts.addHeaderSuccessAlert(headers()); }, function (response) { Alerts.addHeaderErrorAlert(response.headers()); }); } }); } } })();
import React, { Component } from 'react'; import './App.css'; import './App.scss'; import { BrowserRouter as Router,Route, Switch } from 'react-router-dom'; import PhoneVertification from './components/auth/PhoneVertification'; import Register from './components/auth/Register'; import Login from './components/auth/Login'; import ForgetPass from './components/auth/ForgetPass'; import SendPassSuccess from './components/auth/SendPassSuccess'; import RegisterSuccess from './components/auth/RegisterSuccess'; import jwt_decode from 'jwt-decode'; import setAuthToken from './utils/setAuthToken'; import { setCurrentUser, logoutUser } from './store/actions/authActions'; import { Provider } from 'react-redux'; import store from './store/store'; import PrivateRoute from './components/common/PrivateRoute'; import NotFound from './components/not-found/NotFound'; import DefaultLayout from './components/layout/DefaultLayout'; import UploadImage from './components/uploadImage/UploadImage'; import DefaultLayoutAdmin from './components/admin-dashboard/layout/DefaultLayoutAdmin'; // Check for token if (localStorage.jwtToken) { // Set auth token header auth setAuthToken(localStorage.jwtToken); // Decode token and get user info and exp const decoded = jwt_decode(localStorage.jwtToken); // Set user and isAuthenticated store.dispatch(setCurrentUser(decoded)); // Check for expired token const currentTime = Date.now() / 1000; if (decoded.exp < currentTime) { // Logout user store.dispatch(logoutUser()); // TODO: Clear current Profile // Redirect to login window.location.href = '/login'; } } class App extends Component { render() { return ( <Provider store={store}> <Router> <div className="App"> <Route exact path="/" component={Login} /> <Route exact path="/phoneVertification" component={PhoneVertification} /> <Route exact path="/register" component={Register} /> <Route exact path="/login" component={Login} /> <Route exact path="/forgetPass" component={ForgetPass} /> <Route exact path="/sendPassSuccess" component={SendPassSuccess} /> <Route exact path="/register-success" component={RegisterSuccess} /> <Route exact path="/upload" component={UploadImage} /> <Switch> <PrivateRoute path="/pro" component={DefaultLayout} /> <PrivateRoute path="/profile" component={DefaultLayout} /> <PrivateRoute path="/product/add" component={DefaultLayout} /> <PrivateRoute path="/product/edit" component={DefaultLayout} /> <PrivateRoute path="/product" component={DefaultLayout} /> <PrivateRoute path="/chgpwd" component={DefaultLayout} /> <PrivateRoute path="/category" component={DefaultLayout} /> <PrivateRoute path="/locationDetail" component={DefaultLayout} /> {/* admin */} <PrivateRoute path="/admin/allusers" component={DefaultLayoutAdmin}/> <PrivateRoute path="/admin/report" component={DefaultLayoutAdmin} /> <PrivateRoute path="/admin/report/detail" component={DefaultLayoutAdmin} /> <PrivateRoute path="/admin/category/location" component={DefaultLayoutAdmin} /> <PrivateRoute path="/admin/category/post" component={DefaultLayoutAdmin} /> <PrivateRoute path="/admin/location" component={DefaultLayoutAdmin} /> <PrivateRoute path="/admin/location/add" component={DefaultLayoutAdmin} /> <PrivateRoute path="/admin/location/edit" component={DefaultLayoutAdmin} /> <PrivateRoute path="/admin/chgpwd" component={DefaultLayoutAdmin} /> </Switch> <Route exact path="/not-found" component={NotFound} /> </div> </Router> </Provider> ); } } export default App;
import React from 'react'; import './App.css'; class App extends React.Component { constructor(props) { super(props); } // add a componentDidMount lifecycle method to fetch data from the API render() { return ( <div className="App"> <h1>2018 NYC Squirrel Survey Data</h1> </div> ); } } export default App;
import * as t from '../../constants/event' export const getEvent = (payload) => ({ type: t.GET_EVENT, payload })
import { join, dirname, resolve } from 'path'; import findup from 'findup'; import dotenv from 'dotenv'; import { runServer } from './'; import { readFileSync } from 'fs'; // For some reason __dirname resolves to / on current centos // server, but __filename is correct. dotenv.config( { path: join(findup.sync(resolve('.'), '.env'), '.env') } ); const basePath = resolve(__dirname, '../src'); const statsPath = resolve(join(basePath, '..', 'webpack-stats.json')); const stats = readFileSync(statsPath, { encoding: 'utf-8' }); const { assetsByChunkName } = JSON.parse(stats); runServer( { host: process.env.HOST , port: process.env.PORT , assets: assetsByChunkName.app , assetsHost: process.env.ASSETS_HOST });
bridge.controller('SettingsModalController', ['$http', '$humane', '$log', '$modalInstance', '$scope', 'authService', 'formService', 'modalService', function($http, $humane, $log, $modalInstance, $scope, authService, formService, modalService) { formService.initScope($scope, 'settings'); $http.get('/api/v1/users/profile') .success(function(data, status, headers, config) { // These are all the fields the /api/users/profile call will need to return eventually. $scope.profile = { // TODO Eventually need to add other fields, such as avatar image, // the ability to be asked about future studies, etc. firstName: data.firstName, lastName: data.lastName, username: data.username, email: data.email, }; }) .error($humane.status); $scope.session = authService; $scope.cancel = function() { $modalInstance.dismiss('cancel'); }; $scope.submit = function() { // Only two items possible to update are first name and last name. var update = formService.formToJSON($scope.settings, ['firstName', 'lastName']); $http.post('/api/v1/users/profile', update) .success(function(data, status, headers, config) { $modalInstance.close('success'); $humane.confirm('Your information has been successfully updated.'); $log.info(data); }) .error($humane.status); }; $scope.changePassword = function() { modalService.openModal('RequestResetPasswordModalController', 'sm', '/shared/views/requestResetPassword.html'); }; $scope.withdrawStudy = function() { $http.delete('/api/v1/users/consent') .success(function(data, status, headers, config) { $scope.setMessage('You have successfully withdrawn from the study.'); $scope.session.consented = false; }) .error($humane.status); }; $scope.emailConsent = function() { $http.post('/api/v1/users/consent/email') .success(function(data, status, headers, config) { $scope.setMessage('Check your email! You should be receiving a copy of the consent document shortly.'); }) .error($humane.status); }; // TODO Not yet implemented on back end. Will need to return to this later. $scope.downloadData = function() { $log.info('Download data function has been called.'); }; } ]);
// Write all the Strings const strings = { SKILL_NAME: [ 'DEFAULT SKILL NAME' ], WELCOME: [ 'Olá, bem-vindo a {SKILL_NAME}.' ], HELP: [ 'LA AYUDA DEBE SER ESPECIFICA PARA CADA SKILL Y NO DEBE OBTENERSE DEL BASE' ], WELCOME_REPROMPT: [ 'Para obter mais informações, diga "Ajuda"', 'Diga "Ajuda" se precisar de mais informações', ], WAIT_FOR_MORE_INSTRUCTIONS: [ 'Posso te ajudar de alguma forma?' ], LEGAL: [ 'Lembre-se de que as informações fornecidas são aproximadas e a precisão dos dados não é garantida' ], CONTINUE: [ 'Posso te ajudar de alguma forma?' ], EXIT: [ 'Adeus, tenha um bom dia!', 'Adeus', 'Vê você! Espero ter ajudado' ], UNHANDLED: [ "Não tenho certeza do que você disse.", "Sinto muito, tente novamente. Se o erro persistir, tente formular o comando de outra forma." ], ERROR_MESSAGE: [ 'Erro ao processar a resposta. Não consegui entender sua pergunta.', 'Ocorreu um erro não controlado.' ], REPEAT_ERROR: [ "Desculpe, não posso repetir, tente outra ação" ], FALLBACK: [ "Parece que não entendi o que você disse, tente dizer ajuda." ], GENERIC_ERROR: [ 'Desculpe, <break time="400ms"/> ocorreu um erro e não consegui obter a informação.' ], APL_WELCOME: [ 'Olá!' ], APL_WELCOME_HINTS: [ 'ajuda' ], APL_HELP: [ "Estou esperando seu comando" ], APL_HINTS: [ // Listado de intents sugeridos en las vistas (Ask Alexa, XXXXXX) 'ajuda' ], APL_ERROR: [ 'Aconteceu um erro' ] } /** * Define all the Keys used in the Strings * "key" : "Decription" * */ const keys = { 'SKILL_NAME': "Name of the skill" } module.exports = { STRINGS: strings, KEYS: keys }
const Engine = Matter.Engine; const World= Matter.World; const Bodies = Matter.Bodies; const Constraint = Matter.Constraint; var bg; var monster; var superhero; var ground; var hero; var fly; var block1, block2, block3, block4, block5, block6, block7; var block8, block9, block10, block11, block12, block13, block14; var block15, block16, block17, block18, block19, block20; var block21, block22, block23, block24, block25, block26; function preload() { bg = loadImage("GamingBackground.png"); } function setup() { createCanvas(3000, 800); engine = Engine.create(); world = engine.world; block1 = new Block(600,565,40,40); block2 = new Block(600,525,40,40); block3 = new Block(600,485,40,40); block4 = new Block(600,445,40,40); block5 = new Block(600,405,40,40); block6 = new Block(600,365,40,40); block7 = new Block(600,325,40,40); block8 = new Block(660,565,40,40); block9 = new Block(660,525,40,40); block10 = new Block(660,485,40,40); block11 = new Block(660,445,40,40); block12 = new Block(660,405,40,40); block13 = new Block(660,365,40,40); block14 = new Block(720,565,40,40); block15 = new Block(720,525,40,40); block16 = new Block(720,485,40,40); block17 = new Block(720,445,40,40); block18 = new Block(720,405,40,40); block19 = new Block(720,365,40,40); block20 = new Block(720,325,40,40); block21 = new Block(720,285,40,40); // block22 = new Block(200,200,20,20); // block23 = new Block(200,200,20,20); // block24 = new Block(200,200,20,20); // block25 = new Block(200,200,20,20); // block26 = new Block(200,200,20,20); ground = new Ground(1500,600,3000,30); hero = new Hero(300,450); fly = new Fly(hero.body, {x: 250, y: 40}); } function draw() { background(bg); ground.display(); hero.display(); fly.display(); block1.display(); block2.display(); block3.display(); block4.display(); block5.display(); block6.display(); block7.display(); block8.display(); block9.display(); block10.display(); block11.display(); block12.display(); block13.display(); block14.display(); block15.display(); block16.display(); block17.display(); block18.display(); block19.display(); block20.display(); block21.display(); // block22.display(); // block23.display(); // block24.display(); // block25.display(); // block26.display(); } function mouseDragged() { Matter.Body.setPosition(hero.body, {x: mouseX, y: mouseY}); }