text
stringlengths 7
3.69M
|
|---|
import React from 'react';
import './App.css';
import Header from "./components/Header/Header";
import Nav from "./components/Nav/Nav";
import { BrowserRouter } from "react-router-dom";
import { ThemeProvider, createMuiTheme, responsiveFontSizes } from '@material-ui/core/styles';
function App() {
return (
<BrowserRouter>
<div className = "wrapper" >
<Header />
<Nav />
</div>
</BrowserRouter >
);
}
export default App;
|
import React from "react";
import icon from "./icon.png";
import { NavLink } from "react-router-dom";
import s from "./Header.module.css";
import Auth from "./Auth/Auth";
function Header(props) {
return (
<header className={s.header}>
<NavLink to="/">
<img src={icon} alt="icon" />
</NavLink>
<h1>Social-Network.samurai</h1>
<Auth authData={props.authData} logout={props.logout} />
</header>
);
}
export default Header;
|
'use strict'
const express = require('express');
const path = require('path');
const favicon = require('serve-favicon');
const logger = require('morgan');
//const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
const config = require('./config');
const tool = require('./tool');
const apiRouter = require('./routes/api');
const app = express();
// babel 编译
require('babel-core/register');
// view engine setup
//app.set('views', path.join(__dirname, 'views'));
//app.set('view engine', 'jade');
// uncomment after placing your favicon in /public
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
//app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
// 跨域支持
app.all('/api/*', (req, res, next) => {
const origin = req.headers.origin;
if (config.whiteOrigins.indexOf(origin) !== -1) {
res.header('Access-Control-Allow-Origin', origin);
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, token');
res.header('Access-Control-Allow-Credentials', true);
res.header('Access-Control-Allow-Methods', 'GET, POST, PUT, OPTIONS, DELETE');
}
next();
});
// api
app.use('/api', apiRouter);
// catch 404 and forward to error handler
app.use((req, res, next) => {
tool.l('this is an error')
res.sendFile(path.dirname(require.main.filename) + '/public/index.html');
});
module.exports = app;
|
import React from 'react';
import { Box } from '@sparkpost/matchbox';
import { tokens } from '@sparkpost/design-tokens';
import { PlayCircleFilled, PauseCircleFilled } from '@sparkpost/matchbox-icons';
import styled, { keyframes } from 'styled-components';
const move = keyframes`
0%, 100% { transform: translateY(0); }
50% { transform: translateY(calc(100% - 2.5rem)); }
`;
const Animator = styled(Box)`
animation-fill-mode: both;
animation-iteration-count: infinite;
animation-name: ${move};
animation-timing-function: ${tokens.motionEase_in_out};
${props => ({ animationPlayState: props.playing ? 'running' : 'paused' })}
${props => ({
animationDuration: `${Number(tokens[props.speed].replace('s', '')) * 2}s`
})}
`;
function Speed() {
const [playing, setPlaying] = React.useState(false);
return (
<Box>
<Box display="flex">
<Box as="strong" fontWeight="500" flex="1 0 0">
Example
</Box>
<Box
display="inline-flex"
alignItems="center"
as="button"
padding="0"
bg="transparent"
color="blue.700"
border="none"
mb="200"
onClick={() => setPlaying(!playing)}
>
{playing ? <PauseCircleFilled /> : <PlayCircleFilled />}
<Box as="span" display="inline-block" pl="200">
{playing ? ' Pause Animation' : 'Play Animation'}
</Box>
</Box>
</Box>
<Box
display="flex"
justifyContent="space-around"
bg="gray.200"
py="800"
px="200"
height="18rem"
borderRadius="200"
>
<Box display="flex" height="35%" width="1.25rem" position="relative">
<Animator speed="motionDuration_fast" playing={playing}>
<Box
width="1.25rem"
height="1.25rem"
bg="purple.700"
borderRadius="circle"
></Box>
</Animator>
<Box
position="absolute"
top="-2.5rem"
left="-10px"
right="-10px"
textAlign="center"
fontSize="100"
color="gray.700"
>
Fast
</Box>
</Box>
<Box display="flex" height="60%" width="2.5rem" position="relative">
<Animator speed="motionDuration_medium" playing={playing}>
<Box
width="2.5rem"
height="2.5rem"
bg="purple.700"
borderRadius="circle"
></Box>
</Animator>
<Box
position="absolute"
top="-2.5rem"
left="-10px"
right="-10px"
textAlign="center"
fontSize="100"
color="gray.700"
>
Medium
</Box>
</Box>
<Box display="flex" height="100%" width="3.75rem" position="relative">
<Animator speed="motionDuration_slow" playing={playing}>
<Box
width="3.75rem"
height="3.75rem"
bg="purple.700"
borderRadius="circle"
></Box>
</Animator>
<Box
position="absolute"
top="-2.5rem"
left="0"
right="0"
textAlign="center"
fontSize="100"
color="gray.700"
>
Slow
</Box>
</Box>
</Box>
</Box>
);
}
export { Speed };
|
const fs = require('fs');
const read = async (f_path, callback) => {
fs.readFile( f_path, (err, data) => {
console.log(data.toString());
})
}
const write = async (f_path, content, callback) => {
fs.writeFile(f_path, content, (err) => {
if (err) {
console.error('Error writing on the file: ', err);
} else {
console.log('File writen correctly.');
}
})
}
const delete_f = async (f_path, callback) => {
fs.unlink(f_path, callback);
}
const main = async () => {
await read(`${__dirname}/file.txt`);
await write(`${__dirname}/file2.txt`, 'I\'m a new file', console.log);
await delete_f(`${__dirname}/file2.txt`, console.log);
}
main();
|
// Component for popup message
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { setPopup } from './actions';
class Popup extends React.PureComponent {
constructor(props) {
super(props);
this.animationListener = this.animationListener.bind(this);
}
componentDidMount() {
// Get the element and initialize animation events
this.el = document.querySelector('.Popup');
this.initAnimationEvents();
}
componentWillUnmount() {
// Remove animation events
this.endAnimationEvents();
}
initAnimationEvents() {
// Add animation events
if (this.el) {
this.el.addEventListener(
'animationstart',
this.animationListener,
false
);
this.el.addEventListener(
'animationend',
this.animationListener,
false
);
this.el.addEventListener(
'animationiteration',
this.animationListener,
false
);
}
}
endAnimationEvents() {
// Remove animation events
if (this.el) {
this.el.removeEventListener(
'animationstart',
this.animationListener,
false
);
this.el.removeEventListener(
'animationend',
this.animationListener,
false
);
this.el.removeEventListener(
'animationiteration',
this.animationListener,
false
);
}
}
animationListener({ type }) {
// Set up animation event listener
// Check animation event.type
switch (type) {
case 'animationstart':
break;
case 'animationend':
// Reset 'showPopup' state when animation ends
this.props.setPopup(false);
break;
case 'animationiteration':
break;
default:
}
}
render() {
const classes = `Popup ${this.props.showPopup ? 'Popup-show' : 'Popup-hide'}`;
return (
<p className={classes}>
{this.props.children}
</p>
);
}
}
Popup.propTypes = {
showPopup: PropTypes.bool.isRequired,
setPopup: PropTypes.func.isRequired,
children: PropTypes.node,
};
Popup.defaultProps = {
children: null,
};
const mapState = (state) => ({
showPopup: state.showPopup,
});
// Action creators to dispatch. Calls bindActionCreators internally
const mapDispatch = {
setPopup,
};
export default connect(
mapState,
mapDispatch
)(Popup);
|
import React, { useState } from "react";
import NotesList from "./NotesList";
import SearchField from "./SearchField";
import styled from "styled-components";
const Sidebar = () => {
const [search, setSearch] = useState("");
const handleChange = (e) => {
setSearch(e.target.value);
};
return (
<>
<SearchField handleChange={handleChange} />
<NoteListWrapper>
<NotesList search={search} />
</NoteListWrapper>
</>
);
};
export default Sidebar;
const NoteListWrapper = styled.div`
display: flex;
flex-direction: column-reverse;
`;
|
/* eslint-disable */
'use strict';
const fs = require('fs')
const paths = require('./paths');
// todo get process.args
const args = [...process.argv].slice(2)
fs.createReadStream(`${paths.envFiles}/.env.${args[0]||'default'}.js`)
.pipe(fs.createWriteStream(paths.dotenv));
|
var tape = require('tape')
var m = require('../util')
var mount = m.mount
var unmount = m.unmount
tape('mount manifest at root', function (t) {
var manf = {}
mount(manf, [], {thing: 'async'})
t.deepEqual(manf, {thing: 'async'})
mount(manf, ['foo'], {thing: 'async'})
t.deepEqual(manf, {thing: 'async', foo: {thing: 'async'}})
t.end()
})
tape('without mount without path should throw', function (t) {
t.throws(function () {
mount({}, {thing: 'async'})
})
t.end()
})
tape('unmount', function (t) {
var manf = {}
mount(manf, ['foo'], {one: 'async'})
mount(manf, ['bar'], {two: 'async'})
t.deepEqual(manf, {foo: {one: 'async'}, bar: {two: 'async'}})
unmount(manf, ['foo'])
t.deepEqual(manf, {bar: {two: 'async'}})
t.end()
})
tape('deep unmount', function (t) {
var manf = {}
mount(manf, ['foo'], {one: 'async'})
mount(manf, ['foo', 'bar'], {two: 'async'})
t.deepEqual(manf, {foo: {one: 'async', bar: {two: 'async'}}})
unmount(manf, ['foo', 'bar'])
t.deepEqual(manf, {foo: {one: 'async'}})
t.end()
})
tape('deep unmount 2', function (t) {
var manf = {}
m.mount(manf, ['foo', 'bar'], {two: 'async'})
t.deepEqual(manf, {foo: {bar: {two: 'async'}}})
m.unmount(manf, ['foo', 'bar'])
t.deepEqual(manf, {})
t.end()
})
|
'use strict';
const IGLU_SCHEMA_PREFIX = 'iglu:'; // TODO: Refactor: this constant is duplicated
const IGLU_SCHEMA_REGEX = RegExp('^iglu:([a-zA-Z0-9-_.]+)/([a-zA-Z0-9-_]+)/([a-zA-Z0-9-_]+)/((?:[0-9]+-)?[0-9]+-[0-9]+)$');
let isMyJsonValid = require('is-my-json-valid');
class Schema {
constructor (json) {
if (json.constructor === String) {
this.schema = JSON.parse(json);
} else {
this.schema = json;
}
}
validate (obj) {
let validate = isMyJsonValid(this.schema);
let isValid = validate(obj);
let result = { isValid: isValid, errors: validate.errors, object: obj, schema: this.schema };
if (!result.isValid) {
result.error = 'SchemaMismatch';
result.message = result.errors.reduce(function (memo, item) {
memo.push(item.field + ' ' + item.message);
return memo;
}, []).join('; ');
} else {
result.message = 'Successful validation';
}
return result;
}
}
class SchemaKeyFormatError {
constructor (key) {
this.key = key;
this.message = 'does not match the required format';
}
toString () {
return this.key + ' ' + this.message;
}
}
class SchemaMetadata {
static FromSchemaKey (key) {
let m = key.match(IGLU_SCHEMA_REGEX); // TODO: Refactor to class variable
if (m) {
let vendor = m[1];
let name = m[2];
let format = m[3];
let version = m[4];
return new SchemaMetadata(vendor, name, format, version);
} else {
throw new SchemaKeyFormatError(key);
}
}
constructor (vendor, name, format, version) {
this.vendor = vendor;
this.name = name;
this.format = format;
this.version = version;
}
get key () { // Refactor to default parameter
return IGLU_SCHEMA_PREFIX + [this.vendor, this.name, this.format, this.version].join('/');
}
toString () {
return this.key;
}
}
module.exports.Schema = Schema;
module.exports.SchemaMetadata = SchemaMetadata;
module.exports.SchemaKeyFormatError = SchemaKeyFormatError;
|
import React, { Fragment, useState, useEffect } from 'react';
import { useHistory} from 'react-router-dom';
import {Input, Select, DatePicker, Button, Cascader } from 'antd';
const { Option } = Select;
const { RangePicker } = DatePicker;
const { TextArea } = Input;
import './search-condition-list.less'
import { lib } from '../index'
import moment from 'moment'
function Text({item}){
let [refresh, setRefresh] = useState(0);
return (
<div className='group' >
<label>{item.label}</label>
<Input
value={item.value || ''}
style={{ width: 260 }}
onChange={ e => {
item.value = e.target.value;
setRefresh(++refresh);
}}
placeholder={item.extra || '请输入' + item.label} />
</div>
)
}
function CommonSelect({item}){
let [refresh, setRefresh] = useState(0);
return (
<div className='group' >
<label>{item.label}</label>
<Select
allowClear
style={{ width: 260 }}
placeholder='请选择'
onChange={(value) => {
item.value = value;
setRefresh(++refresh);
}}
value={item.value}>
{
(item.list || []).map((item, index) =>
<Option key={index} value={item.id}>{item.name}</Option>
)
}
</Select>
</div>
)
}
function SearchSelect({item}){
let [refresh, setRefresh] = useState(0);
return (
<div className='group' >
<label>{item.label}</label>
<Select
allowClear
showSearch
style={{ width: 260 }}
placeholder='请选择'
optionFilterProp="children"
onChange={(value) => {
item.value = value;
setRefresh(++refresh);
}}
value={item.value}>
{
(item.list || []).map((item, index) =>
<Option key={index} value={item.id}>{item.name}</Option>
)
}
</Select>
</div>
)
}
function MultiSelect({item}){
let [refresh, setRefresh] = useState(0);
return (
<div className='group' >
<label>{item.label}</label>
<Select
allowClear
showSearch
style={{ width: 260 }}
placeholder='请选择'
mode="multiple"
onChange={(value) => {
item.value = value;
setRefresh(++refresh);
}}
value={item.value}>
{
(item.list || []).map((item, index) =>
<Option key={index} value={item.id}>{item.name}</Option>
)
}
</Select>
</div>
)
}
function DateControl({item}){
let [refresh, setRefresh] = useState(0);
return (
<div className='group time' >
<label>{item.label}</label>
<RangePicker
style={{ width: 260 }}
value={
(new Date(item.startValue).getTime() && new Date(item.endValue).getTime()) ?
[moment(new Date(item.startValue).getTime()), moment(new Date(item.endValue).getTime())]:
[]
}
onChange={(e, dates) => {
if (!dates[0]) {
item.startValue = '';
item.endValue = '';
}
else {
item.startValue = new Date(dates[0]).getTime();
item.endValue = new Date(dates[1]).getTime() + 24 * 3600 * 1000;
}
setRefresh(++refresh);
}} />
</div>
)
}
function Range({item}){
let [refresh, setRefresh] = useState(0);
return (
<div className='group range' >
<label>{item.label}</label>
<Input value={item.startValue || ''} onChange={(e) => {
item.startValue = e.target.value;
setRefresh(++refresh);
}}></Input>
<span></span>
<Input value={item.endValue || ''} onChange={(e) => {
item.endValue = e.target.value;
setRefresh(++refresh);
}}></Input>
</div>
)
}
function Textarea({item}){
let [refresh, setRefresh] = useState(0);
return (
<div className='group' >
<label>{item.label}</label>
<textarea className='form-control'
value={item.value || ''}
style={{ width: 260 }}
onChange={e => {
item.value = e.target.value;
setRefresh(++refresh);
}}
placeholder={item.extra || '请输入' + item.label}
/>
</div>
)
}
function CascaderControl({item}){
let [refresh, setRefresh] = useState(0);
function onChange(value) {
item.value = value;
setRefresh(++refresh);
}
return (
<div className='group'>
<label>{item.label}</label>
<Cascader options={item.list} onChange={onChange} style={{ width: 260 }} placeholder="" />
</div>
)
}
function SelectTextArea({item}) {
let [refresh, setRefresh] = useState(0);
if (!item.select) {
item.select = JSON.parse(item.extra)[0].id
}
let str = "";
JSON.parse(item.extra).map(item => {
str += item.name + ','
})
return (
<div className='group' >
<label>
<Select
dropdownClassName="in-label-dropMenu"
value={item.select}
onChange={(e) => {
item.select = e;
setRefresh(++refresh);
}}>
{JSON.parse(item.extra).map(ite => {
return <Option value={ite.id} key={ite.id}>{ite.name}</Option>
})}
</Select>
</label>
<TextArea className='form-control'
value={item.value || ''}
style={{ width: 260, height: 69}}
onChange={e => {
item.value = e.target.value;
setRefresh(++refresh);
}}
placeholder={`请输入${str}多条用换行隔开(不超过5000条)`}
/>
</div>
)
}
function SelectInput({item}) {
let [refresh, setRefresh] = useState(0);
if (!item.select) {
item.select = JSON.parse(item.extra)[0].id
}
return (
<div className='group' >
<label>
<Select
dropdownClassName="dropMenu"
value={item.select}
onChange={(e) => {
item.select = e;
setRefresh(++refresh);
}}>
{JSON.parse(item.extra).map(ite => {
return <Option value={ite.id} key={ite.id}>{ite.name}</Option>
})}
</Select>
</label>
<Input
value={item.value || ''}
style={{ width: 260 }}
onChange={e => {
item.value = e.target.value;
setRefresh(++refresh);
}}
/>
</div>
)
}
function SearchConditionList({ searchKeyList , onSearch }){
let [refresh , setRefresh] = useState(0);
let [isMiniType , setType] = useState(false);
let history = useHistory();
function search() {
let searchCondition = {};
var map = new Map();
window.location.search.substring(1).split('&').map((kv) => {
let [key, value] = kv.split('=');
value = decodeURIComponent(value);
map.set(key, value);
if(key != 'config_id' && key != 'page_title'){
searchCondition[key] = value;
}
})
searchKeyList.map((item) => {
if (item.type == 'date' || item.type == 'range') {
if (item.startValue) {
searchCondition[item.startKey] = item.startValue;
searchCondition[item.endKey] = item.endValue;
}
map.set(item.startKey, item.startValue);
map.set(item.endKey, item.endValue);
} else if (item.type == 'multi-select') {
if (item.value.length) {
searchCondition[item.key] = item.value;
}
} else if (item.type == 'select-textarea') {
if (item.value.length) {
let [select, queryNo] = item.key.split(",");
searchCondition[select] = item.select;
searchCondition[queryNo] = item.value.split('\n').map(item => item.trim()).join(',')
}
} else if (item.type == 'select-input') {
if (item.value.length) {
let [select, queryNo] = item.key.split(",");
searchCondition[select] = item.select;
searchCondition[queryNo] = item.value;
}
} else {
if (item.value != '') {
searchCondition[item.key] = item.value;
}
map.set(item.key , item.value);
}
})
var searchUrl = [];
for(var [key , value] of map){
if(value){
searchUrl.push(`${key}=${value}`);
}
}
if(history){
history.replace(`${window.location.pathname}?${searchUrl.join('&')}`);
}
onSearch(searchCondition)
}
function reset(){
searchKeyList.map((item) => {
if (item.type == 'date' || item.type == 'range') {
if (item.startValue) {
item.startValue = item.endValue = '';
}
} else if (item.type == 'multi-select') {
item.value = [];
} else {
item.value = '';
}
})
onSearch({});
setRefresh(++refresh);
}
function initSelect(node) {
lib.request({
url: node.extra,
needMask: false,
success: (data) => {
node.list = data;
setRefresh(++refresh);
}
})
}
function init() {
var map = new Map();
window.location.search.substring(1).split('&').map((kv) => {
let [key , value] = kv.split('=');
if(key == 'page_title' || key == 'config_id' || key == 'refresh_event'){
return;
}
value = decodeURIComponent(value);
map.set(key , value);
})
searchKeyList.map((item) => {
item.value = '';
if (item.type == 'date' || item.type == 'range') {
item.startKey = item.key.split(',')[0];
item.endKey = item.key.split(',')[1];
if (!item.startValue && map.get(item.startKey)){
item.startValue = parseInt(map.get(item.startKey));
item.endValue = parseInt(map.get(item.endKey));
}
}
if (item.type == 'multi-select') {
item.value = [];
}
if (item.type == 'select' || item.type == 'search-select' || item.type == 'multi-select' || item.type == 'cascader') {
if (!item.list) {
initSelect(item);
}
}
if (item.type == 'json-select') {
if (!item.list) {
item.list = JSON.parse(item.extra) || [];
}
}
if(!item.value){
var value = map.get(item.key);
if(item.type != 'text' && item.type != 'textarea'){
value = /^\d+$/.test(value) ? parseInt(value) : value || '';
}
item.value = value;
}
})
setRefresh(++refresh);
search();
}
useEffect(() => {
init()
} , [])
var map = {
'text' : Text ,
'select': CommonSelect ,
'json-select': CommonSelect ,
'search-select': SearchSelect ,
'multi-select' : MultiSelect ,
'date': DateControl ,
'textarea' : Textarea ,
'cascader': CascaderControl,
'select-textarea': SelectTextArea,
'range' : Range,
'select-input': SelectInput
}
return (
<div className={isMiniType ? 'mini-search-controls' : 'full-search-controls'}>
<div className='search-controls'>
{searchKeyList.map((item , key) => {
var Control = map[item.type];
return Control && <Control item={item} key={`${location.path}/${key}`} />
})}
</div>
<div className='group group-btns' >
<Button type="primary" onClick={search}>查询</Button>
<Button onClick={reset}>重置</Button>
</div>
<div className='change-type' ></div>
<div className='change-type-click' onClick={() => setType(!isMiniType)}></div>
</div>
)
}
export default SearchConditionList;
|
/**
*
*/
/**
* 标准的 搜索栏 按钮栏 表格 页面,拉升表格 填充整个页面
*/
var adjustCommonTablePage = function(){
var windowHeight = $(window).innerHeight();
var searchboxHeight = $('.ik-searcharea').outerHeight();
var menubarHeight = $('.ik-menubar').outerHeight();
var paginatorHeight = $('.ik-datatable .ui-paginator').outerHeight();
$('.ik-datatable .ui-datatable-tablewrapper').height(windowHeight - searchboxHeight - menubarHeight
- paginatorHeight - 20)
.css('overflow', 'auto')
.css('overflow-x','auto');
};
/**
* 调整textarea在表单中的样式
*/
var adjustTextareaCssInGrid = function(){
$('.ik-textarea-colspan-3').parent().attr("colspan", 3);
$('.ik-textarea-colspan-3').css("width", "92.3%");
};
|
/**
* Loading this script file extends all flowlet objects with
* validation capabilities.
*/
(function () {
Flowlet.Factory.extend ( {
/**
*
*/
withValidationIcon : function () {
var form =
this
.withElementWrapper(function(el,l) {
var pan = Element.mk("div");
var icon = Element.mk("div", {attrs: {'class' : 'valid'}});
var label = Element.mk("label");
if(l !== undefined) {
label.append(l);
}
pan.append(label);
pan.append(el);
pan.append(icon);
return pan;
});
return form;
}
});
}());
|
/* remove this comment and place your JavaScript here */
/*
When did you start studying for exams?
a. 1 month in advance of course(1pt)
b. I start organzing 2 weeks in advance and study the week before(2pt)
c. I'll probably pull an all nighter before each one(3pt)
d. WHAT EXAMS(4pt)
What do you see yourself doing the night before the exam?
a. just reviewing everything I've been studying (1pt)
b. Color coding a schedule for after exams(2pt)
c. I'm beginning my all nighter(3pt)
d. WHAT EXAMS,I've already fallen asleep(4pt)
What do you ask the teacher at a review session?
a. I have a list of well thought out and specific questions that I've already asked three other people about(1pt)
b. the best way to organize for exams(2pt)
c. how much studying is necessary( i.e. how many hours do I have to study minimum)(3pt)
d. HAha YoU ThINK i WouLd Go To A STudY sESSion(-_-)(4pt)
0pt: rachel
3-4pt:roygbiv
5-7pt:procrastination
8-9pt:he-who-must-not-be-named
*/
var time = null,
asking = null,
doing = null,
pageTitle = document.getElementById('page-title'),
pageTitleText = pageTitle.innerHTML
tryAgain = document.getElementById('try-again'),
quizWrapper = document.getElementById('quiz-wrapper'),
result = document.getElementById('result'),
formSubmit = document.getElementById('form-submit');
tryAgain.addEventListener("click", resetQuiz);
formSubmit.addEventListener("click", processResults);
function processResults(){
time = document.querySelector('input[name="time"]:checked'),
asking = document.querySelector('input[name="asking"]:checked'),
doing = document.querySelector('input[name="doing"]:checked')
if(time == null){
alert("Complete all questions before continuing.");
}else if(asking == null){
alert("Complete all questions before continuing.");
}else if(doing == null){
alert("Complete all questions before continuing.");
}else{
var personality = getPersonality()
quizWrapper.style.display = "none"
formSubmit.style.display = "none"
result.style.display = "block"
tryAgain.style.display = "block"
if(personality == 0){
pageTitle.innerHTML = "You're Rachel Berry"
result.style.backgroundImage = "url('img/rachel.png')"
}else if(personality == 1){
pageTitle.innerHTML = "You're ROYGBIV"
result.style.backgroundImage = "url('img/roygbiv.jpg')"
}else if(personality == 2){
pageTitle.innerHTML = "You're procrastination"
result.style.backgroundImage = "url('img/procrastination.jpg')"
}
else if(personality == 3){
pageTitle.innerHTML = "You're he-who-must-not-be-named"
result.style.backgroundImage = "url('img/notnamed.png')"
}
}
}
function resetQuiz(){
pageTitle.innerHTML = pageTitleText
quizWrapper.style.display = "flex"
result.style.display = "none"
tryAgain.style.display = "none"
formSubmit.style.display = "block"
time.checked = "false"
asking.checked = "false"
doing.checked = "false"
time = null
asking = null
doing = null
}
function getPersonality(){
var score = 0;
if(time.id === "roygbiv1"){
score+=1
}else if(time.id === "procrastination1"){
score+=2
}else if(time.id === "notnamed1"){
score+=3
}
if(doing.id === "roygbiv2"){
score+=1
}else if(doing.id === "procrastination2"){
score+=2
}else if(doing.id === "notnamed2"){
score+=3
}
if(asking.id === "roygbiv3"){
score+=1
}else if(asking.id === "procrastination3"){
score+=2
}else if(asking.id === "notnamed3"){
score+=3
}
console.log(score)
if(score>=0 && score<=2){
return 0
}
if(score>=3 && score<=4){
return 1
}
if(score>=5 && score<=7){
return 2
}
if(score>=8 && score<=9){
return 3
}
}
|
import React from "react";
import { createStackNavigator } from "@react-navigation/stack";
import Initial from './layouts/Content/InitialScreen';
import Login from './layouts/Content/Login/LoginScreen';
import Signup from './layouts/Content/Signup/SignupScreen';
import EmailSign from './layouts/Content/Signup/EmailScreen';
import PwSign from './layouts/Content/Signup/PwSignScreen';
import LicenseScan from './layouts/Content/Signup/LicenseScreen';
import IdFind from './layouts/Content/Login/IdFindScreen';
import PwFind from './layouts/Content/Login/PwFindScreen';
import ScanConfirm from './layouts/Content/Signup/ScanConfirmScreen';
const Stack = createStackNavigator();
const StackNavigator = () => {
return (
<Stack.Navigator>
<Stack.Screen name="Initial" component={Initial} options={{ headerShown: false}} />
<Stack.Screen name="Login" component={Login} />
<Stack.Screen name="Signup" component={Signup} options={{title: '회원가입', headerBackTitleVisible: false }} />
<Stack.Screen name="EmailSign" component={EmailSign} options={{title: '이메일 인증', headerBackTitleVisible: false, }} />
<Stack.Screen name="PwSign" component={PwSign} options={{title: '비밀번호 입력', headerBackTitleVisible: false }} />
<Stack.Screen name="LicenseScan" component={LicenseScan} options={{title: '운전면허 스캔', headerBackTitleVisible: false }} />
<Stack.Screen name="IdFind" component={IdFind} options={{title: '아이디 찾기', headerBackTitleVisible: false }} />
<Stack.Screen name="PwFind" component={PwFind} options={{title: '비밀번호 찾기', headerBackTitleVisible: false }} />
</Stack.Navigator>
);
}
export { StackNavigator };
|
import React, { Component,Fragment } from 'react';
import { Container, Row, Col } from 'react-bootstrap';
import bulletPoint from './../../asset/images/bulletPoint.webp';
import {Link} from "react-router-dom";
class services extends Component {
render() {
return (
<Fragment>
<Container>
<Row>
<Col lg={7} md={7} sm={2}>
<div className="services__banner">
</div>
</Col>
<Col lg={5} md={5} sm={10}>
<p className="services__title">Services</p>
<p className="greyBarBig"></p>
<div className="service__allServiceArea">
<div className="service__allServices ">
<ul>
<li><Link to="/hrServicePage" > <span> <img src={bulletPoint} alt="bullet"/></span> HR Service</Link></li>
<li><Link to="/HrAndPayrollOutsourcingPage"> <span> <img src={bulletPoint} alt="bullet"/></span> HR & Payroll Outsourcing</Link></li>
<li><Link to="/TalentSearchAndOutplacementPage"> <span> <img src={bulletPoint} alt="bullet"/></span> Talent Search & Outplacement</Link></li>
<li><Link to="/HrConsultancyServicesPage"> <span> <img src={bulletPoint} alt="bullet"/></span> HR Consultancy Services</Link></li>
<li><Link to="/CareerCoachingAndMentoringPage"> <span> <img src={bulletPoint} alt="bullet"/></span> Career Coaching and Mentoring</Link></li>
<li><Link to="/TrainingAndDevelopmentPage"> <span> <img src={bulletPoint} alt="bullet"/></span> Training & Development</Link></li>
<li><Link to="/HrAutomationAndHrisConsultancyPage"> <span> <img src={bulletPoint} alt="bullet"/></span> HR Automation & HRIS Consultancy</Link></li>
<li><Link to="/EmployeeBenefitSchemeDesignAndApprovalPage"> <span> <img src={bulletPoint} alt="bullet"/></span> Employee Benefit Scheme Design and Approval</Link></li>
<li><Link to="/BusinessSupportServicesPage"> <span> <img src={bulletPoint} alt="bullet"/></span> Business Support Services</Link></li>
<li><Link to="/ExpatriateAffairsManagementPage"> <span> <img src={bulletPoint} alt="bullet"/></span> Expatriate Affairs Management</Link></li>
<li><Link to="/LicensingServicesPage"> <span> <img src={bulletPoint} alt="bullet"/></span> Licensing Services</Link></li>
<li><Link to="/PersonalTaxManagementPage"> <span> <img src={bulletPoint} alt="bullet"/></span> Personal Tax Management</Link></li>
</ul>
</div>
</div>
</Col>
</Row>
</Container>
</Fragment>
);
}
}
export default services;
|
import React from 'react';
import logo from '../../assets/logo.svg'
import './LoginPage.scss'
function Login() {
return (
<div className="login-page">
<div className="login-container">
<img src={logo} alt="logo"/>
<div className="">
<div className="input-form">
<label>Почта</label>
<div className="">
<input value="your@mail.com"/>
</div>
</div>
<div className="input-form">
<label>Пароль</label>
<div className="">
<input value="0123456" type="password"/>
</div>
</div>
<button className='primary-button'>Войти</button>
</div>
</div>
</div>
);
}
export default Login;
|
import { BINDGROUP_VIEW } from "./constants.js";
/**
* Options to drive shader processing to add support for bind groups and uniform buffers.
*
* @ignore
*/
class ShaderProcessorOptions {
/** @type {import('./uniform-buffer-format.js').UniformBufferFormat[]} */
uniformFormats = [];
/** @type {import('./bind-group-format.js').BindGroupFormat[]} */
bindGroupFormats = [];
/** @type {import('./vertex-format.js').VertexFormat[]} */
vertexFormat;
/**
* Constructs shader processing options, used to process the shader for uniform buffer support.
*
* @param {import('./uniform-buffer-format.js').UniformBufferFormat} [viewUniformFormat] - Format
* of the uniform buffer.
* @param {import('./bind-group-format.js').BindGroupFormat} [viewBindGroupFormat] - Format of
* the bind group.
* @param {import('./vertex-format.js').VertexFormat} [vertexFormat] - Format of the vertex
* buffer.
*/
constructor(viewUniformFormat, viewBindGroupFormat, vertexFormat) {
// construct a sparse array
this.uniformFormats[BINDGROUP_VIEW] = viewUniformFormat;
this.bindGroupFormats[BINDGROUP_VIEW] = viewBindGroupFormat;
this.vertexFormat = vertexFormat;
}
/**
* Get the bind group index for the uniform name.
*
* @param {string} name - The name of the uniform.
* @returns {boolean} - Returns true if the uniform exists, false otherwise.
*/
hasUniform(name) {
for (let i = 0; i < this.uniformFormats.length; i++) {
const uniformFormat = this.uniformFormats[i];
if (uniformFormat?.get(name)) {
return true;
}
}
return false;
}
/**
* Get the bind group texture slot for the texture uniform name.
*
* @param {string} name - The name of the texture uniform.
* @returns {boolean} - Returns true if the texture uniform exists, false otherwise.
*/
hasTexture(name) {
for (let i = 0; i < this.bindGroupFormats.length; i++) {
const groupFormat = this.bindGroupFormats[i];
if (groupFormat?.getTexture(name)) {
return true;
}
}
return false;
}
getVertexElement(semantic) {
return this.vertexFormat?.elements.find(element => element.name === semantic);
}
/**
* Generate unique key representing the processing options.
*
* @param {import('./graphics-device.js').GraphicsDevice} device - The device.
* @returns {string} - Returns the key.
*/
generateKey(device) {
// TODO: Optimize. Uniform and BindGroup formats should have their keys evaluated in their
// constructors, and here we should simply concatenate those.
let key = JSON.stringify(this.uniformFormats) + JSON.stringify(this.bindGroupFormats);
// WebGPU shaders are processed per vertex format
if (device.isWebGPU) {
key += this.vertexFormat?.renderingHashString;
}
return key;
}
}
export { ShaderProcessorOptions };
|
import React, { Fragment } from 'react';
import { Link } from 'gatsby';
import styled from 'react-emotion';
import NavigationList from './navigation';
const TitleContainer = styled('div')`
margin: 0 auto;
width: 85%;
padding: 1.45rem 1.0875rem;
display: inline-block;
`;
const HeaderText = styled('h1')`
margin: 0 auto;
align-content: center;
`;
const Header = ({ siteTitle }) => (
<Fragment>
<NavigationList />
<TitleContainer>
<HeaderText>
<Link
to="/"
style={{
textDecoration: 'none',
}}
>
{siteTitle}
</Link>
</HeaderText>
</TitleContainer>
</Fragment>
)
export default Header
|
import React from "react";
import "./Logo.scss";
import moneysafeLogo from "./assets/moneysafe.svg";
export const logoSizes = {
SM: "sm",
MD: "md",
LG: "lg"
};
export const assets = {
MONEYSAFE: moneysafeLogo
};
const COMPONENT_CLASS = "v-logo";
export const Logo = ({ size, asset, ...otherProps }) => (
<img
className={`${COMPONENT_CLASS} ${COMPONENT_CLASS}--${size}`}
alt="Logo"
src={asset}
{...otherProps}
/>
);
export default Logo;
|
const axios = require('axios');
const getLugarLatLng = async(nombre) => {
const encodedUrl = encodeURI(nombre)
console.log(encodedUrl);
const instance = axios.create({
baseURL: `https://restcountries-v1.p.rapidapi.com/name/${encodedUrl}`,
headers: { 'x-rapidapi-key': '2425a40b9bmsh035e2f77347ab6ap194204jsn92e9b301689c' }
});
const resp = await instance.get();
if (!resp) {
throw new Error(`No hay resultados para ${nombre}`)
}
const name = resp.data[0].name;
const lat = resp.data[0].latlng[0];
const lng = resp.data[0].latlng[1];
return {
name,
lat,
lng
}
}
module.exports = {
getLugarLatLng
}
|
// const Ravepay = require('flutterwave-node');
// // This is the Flutterwave API Credentials
// const rave = new Ravepay(PUBLICK_KEY, SECRET_KEY, false);
// rave.Card.charge(
// {
// "cardno": "5438898014560229",
// "cvv": "564",
// "expirymonth": "10",
// "expiryyear": "20",
// "currency": "NGN",
// "country": "NG",
// "amount": "10",
// "email": "user@gmail.com",
// "phonenumber": "0902620185",
// "firstname": "temi",
// "lastname": "desola",
// "IP": "355426087298442",
// "txRef": "MC-" + Date.now(),// your unique merchant reference
// "meta": [{metaname: "flightID", metavalue: "123949494DC"}],
// "redirect_url": "https://rave-webhook.herokuapp.com/receivepayment",
// "device_fingerprint": "69e6b7f0b72037aa8428b70fbe03986c"
// }
// ).then(resp => {
// // console.log(resp.body);
// rave.Card.validate({
// "transaction_reference":resp.body.data.flwRef,
// "otp":12345
// }).then(response => {
// console.log(response.body.data.tx);
// })
// }).catch(err => {
// console.log(err);
// })
// const Gh_mobilemoney = async ()=>{
// try {
// const payload = {
// "currency": "GHS",
// "payment_type": "mobilemoneygh",
// "country": "GH",
// "amount": "50",
// "email": "user@example.com",
// "phonenumber": "054709929220",
// "network": "MTN",
// "firstname": "temi",
// "lastname": "desola",
// "voucher": "128373", // only needed for Vodafone users.
// "IP": "355426087298442",
// "txRef": "MC-" + Date.now(),
// "orderRef": "MC_" + Date.now(),
// "is_mobile_money_gh": 1,
// "redirect_url": "https://rave-webhook.herokuapp.com/receivepayment",
// "device_fingerprint": "69e6b7f0b72037aa8428b70fbe03986c"
// }
// const response = await rave.MobileMoney.ghana(payload, rave)
// console.log(response);
// } catch (error) {
// console.log(error)
// }
// }
// // Gh_mobilemoney();
// const callMpesa = async ()=>{
// const payload = {
// "currency": "KES",
// "country": "KE",
// "amount": "100",
// "phonenumber": "0926420185",
// "email": "user@example.com",
// "firstname": "jsksk",
// "lastname": "ioeoe",
// "IP": "40.14.290",
// "narration": "funds payment",
// "txRef": "jw-222",
// "meta": [{metaname: "extra info", metavalue: "a pie"}],
// "device_fingerprint": "89191918hgdgdg99191", //(optional)
// "payment_type": "mpesa",
// "is_mpesa": "1",
// "is_mpesa_lipa": 1
// }
// try {
// const response = await rave.MobileMoney.mpesa(payload, rave)
// console.log(response);
// } catch (error) {
// console.log(error)
// }
// }
// // callMpesa();
// const zmw_mobilemoney= async ()=>{
// const payload = {
// "currency": "ZMW",
// "payment_type": "mobilemoneyzambia",
// "country": "NG",
// "amount": "50",
// "email": "user@example.com",
// "phonenumber": "054709929220",
// "network": "MTN",
// "firstname": "temi",
// "lastname": "desola",
// "IP": "355426087298442",
// "txRef": "MC-" + Date.now(),
// "orderRef": "MC_" + Date.now(),
// "is_mobile_money_ug": 1,
// "redirect_url": "https://rave-webhook.herokuapp.com/receivepayment",
// "device_fingerprint": "69e6b7f0b72037aa8428b70fbe03986c"
// }
// try {
// const response = await rave.MobileMoney.zambia(payload, rave)
// console.log(response);
// } catch (error) {
// console.log(error)
// }
// }
// // zmw_mobilemoney();
// //
// const Ugx_mob_money= async ()=>{
// const payload = {
// "currency": "UGX",
// "payment_type": "mobilemoneyuganda",
// "country": "NG",
// "amount": "50",
// "email": "user@example.com",
// "phonenumber": "054709929220",
// "network": "UGX",
// "firstname": "temi",
// "lastname": "desola",
// "IP": "355426087298442",
// "txRef": "MC-" + Date.now(),
// "orderRef": "MC_" + Date.now(),
// "is_mobile_money_ug": 1,
// "redirect_url": "https://rave-webhook.herokuapp.com/receivepayment",
// "device_fingerprint": "69e6b7f0b72037aa8428b70fbe03986c"
// }
// try {
// const response = await rave.MobileMoney.uganda(payload, rave)
// console.log(response);
// } catch (error) {
// console.log(error)
// }
// }
// // Ugx_mob_money();
// const rwn_mobilemoney= async ()=>{
// const payload = {
// "currency": "RWF",
// "payment_type": "mobilemoneygh",
// "country": "NG",
// "amount": "50",
// "email": "user@example.com",
// "phonenumber": "054709929220",
// "network": "RWF",
// 'accountnumber': "089909qw",
// "firstname": "temi",
// "lastname": "desola",
// "IP": "355426087298442",
// "txRef": "MC-" + Date.now(),
// "orderRef": "MC_" + Date.now(),
// "is_mobile_money_gh": 1,
// "redirect_url": "https://rave-webhook.herokuapp.com/receivepayment",
// "device_fingerprint": "69e6b7f0b72037aa8428b70fbe03986c"
// }
// try {
// const response = await rave.MobileMoney.rwanda(payload, rave)
// console.log(response);
// } catch (error) {
// console.log(error)
// }
// }
// // rwn_mobilemoney();
// const franco_mobilemoney= async ()=>{
// const payload = {
// "currency": "XAF",
// "amount": "50",
// "email": "user@example.com",
// "phonenumber": "054709929220",
// "firstname": "temi",
// "lastname": "desola",
// "IP": "355426087298442",
// "txRef": "MC-" + Date.now(),
// "orderRef": "MC_" + Date.now(),
// "is_mobile_money_franco": 1,
// "device_fingerprint": "69e6b7f0b72037aa8428b70fbe03986c"
// }
// try {
// const response = await rave.MobileMoney.francophone(payload, rave)
// console.log(response);
// } catch (error) {
// console.log(error)
// }
// }
// // franco_mobilemoney();
// const callVerify = async (ref) => {
// const payload = {
// txref:ref
// }
// try {
// const response = await rave.VerifyTransaction.verify(payload, rave)
// console.log(response);
// } catch (error) {
// console.log(error)
// }
// }
// // callVerify("rave-123456");
// console.log("[done]")
// const get_balance= async ()=> {
// const payload = {
// service: "rates_convert",
// service_method: "post",
// service_version: "v1",
// service_channel: "rave",
// currency:"NGN" // for single balance. For all balance don't add currency
// };
// try {
// const response = await rave.Misc.getBalance(payload, rave);
// console.log(response);
// } catch (error) {
// console.log(error);
// }
// };
// // get_balance();
|
const { setInterval, clearInterval } = require('long-timeout')
const { toMilliseconds } = require('./../../durationConverter')
class IntervalTaskRunner {
run(task) {
this.timeout = setInterval(task.fn, toMilliseconds(task.timing))
}
stop(task) {
clearInterval(this.timeout)
}
}
module.exports = IntervalTaskRunner
|
rawexample = true;
|
const path = require('path');
module.exports = {
port: 80,
apiVersion: '/api/v1'
};
|
import React from "react";
function HelpScreen(props) {
return <div>Help</div>;
}
export default HelpScreen;
|
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
// Jobs database schema
const jobSchema = new Schema({
url: String,
title: String,
company_name: String,
category: String,
job_type: String,
publication_date: Date,
candidate_required_location: String,
salary: String,
description: String,
company_logo_url: String
});
// Export the whole schema
const Job = mongoose.model("Jobs", jobSchema);
module.exports = Job;
|
// Aula 17 - 20/09/2021
// Métodos Avançados
// ex10Flat.js
// Flat = Plano
// Método Insere um sub-array dentro do array principal
let numeros = [1,2,3,[4,5,[6,7]]]; //[array principal,[sub-array[sub-array]]
// => Método Insere um subarray no array pai
console.log(numeros);
novoArray = numeros.flat(2);
console.log(novoArray);
|
var iszoomon = false;
var port = chrome.runtime.connect({name: "backpage"});
var message = "";
function commication(){
chrome.runtime.onConnect.addListener(function(port){
port.postMessage({fromBack:"here"});
port.onMessage.addListener(function(msg){
console.log(msg.fromRunning);
if(msg.fromRunning === "send back"){
}
});
}
)}
commication();
|
if (typeof(PhpDebugBar) == 'undefined') {
// namespace
var PhpDebugBar = {};
}
/**
* @namespace
*/
PhpDebugBar.Widgets = (function($) {
var widgets = {};
/**
* Replaces spaces with and line breaks with <br>
*
* @param {String} text
* @return {String}
*/
var htmlize = function(text) {
return text.replace(/\n/g, '<br>').replace(/\s/g, " ")
};
widgets.htmlize = htmlize;
/**
* Returns a string representation of value, using JSON.stringify
* if it's an object.
*
* @param {Object} value
* @param {Boolean} prettify Uses htmlize() if true
* @return {String}
*/
var renderValue = function(value, prettify) {
if (typeof(value) !== 'string') {
if (prettify) {
return htmlize(JSON.stringify(value, undefined, 2));
}
return JSON.stringify(value);
}
return value;
};
widgets.renderValue = renderValue;
// ------------------------------------------------------------------
// Generic widgets
// ------------------------------------------------------------------
/**
* Displays array element in a <ul> list
*
* @this {ListWidget}
* @constructor
* @param {Array} data
* @param {Function} itemRenderer Optional
*/
var ListWidget = function(data, itemRenderer) {
this.element = $('<ul class="phpdebugbar-widgets-list" />');
if (itemRenderer) {
this.itemRenderer = itemRenderer;
}
if (data) {
this.setData(data);
}
};
/**
* Sets the data and updates the list
*
* @this {ListWidget}
* @param {Array} data
*/
ListWidget.prototype.setData = function(data) {
this.element.empty();
for (var i = 0; i < data.length; i++) {
var li = $('<li class="list-item" />').appendTo(this.element);
this.itemRenderer(li, data[i]);
}
};
/**
* Renders the content of a <li> element
*
* @this {ListWidget}
* @param {jQuery} li The <li> element as a jQuery Object
* @param {Object} value An item from the data array
*/
ListWidget.prototype.itemRenderer = function(li, value) {
li.html(renderValue(value));
};
widgets.ListWidget = ListWidget;
// ------------------------------------------------------------------
/**
* Displays object property/value paris in a <dl> list
*
* @this {KVListWidget}
* @constructor
* @param {Object} data
* @param {Function} itemRenderer Optional
*/
var KVListWidget = function(data, itemRenderer) {
this.element = $('<dl class="phpdebugbar-widgets-kvlist" />');
if (itemRenderer) {
this.itemRenderer = itemRenderer;
}
if (data) {
this.setData(data);
}
};
/**
* Sets the data and updates the list
*
* @this {KVListWidget}
* @param {Object} data
*/
KVListWidget.prototype.setData = function(data) {
var self = this;
this.element.empty();
$.each(data, function(key, value) {
var dt = $('<dt class="key" />').appendTo(self.element);
var dd = $('<dd class="value" />').appendTo(self.element);
self.itemRenderer(dt, dd, key, value);
});
};
/**
* Renders the content of the <dt> and <dd> elements
*
* @this {KVListWidget}
* @param {jQuery} dt The <dt> element as a jQuery Object
* @param {jQuery} dd The <dd> element as a jQuery Object
* @param {String} key Property name
* @param {Object} value Property value
*/
KVListWidget.prototype.itemRenderer = function(dt, dd, key, value) {
dt.text(key);
dd.html(htmlize(value));
};
widgets.KVListWidget = KVListWidget;
// ------------------------------------------------------------------
/**
* An extension of KVListWidget where the data represents a list
* of variables
*
* @this {VariableListWidget}
* @constructor
* @param {Object} data
*/
var VariableListWidget = function(data) {
KVListWidget.apply(this, [data]);
this.element.addClass('phpdebugbar-widgets-varlist');
};
VariableListWidget.prototype = new KVListWidget();
VariableListWidget.constructor = VariableListWidget;
VariableListWidget.prototype.itemRenderer = function(dt, dd, key, value) {
dt.text(key);
var v = value;
if (v.length > 100) {
v = v.substr(0, 100) + "...";
}
dd.text(v).click(function() {
if (dd.hasClass('pretty')) {
dd.text(v).removeClass('pretty');
} else {
dd.html(htmlize(value)).addClass('pretty');
}
});
};
widgets.VariableListWidget = VariableListWidget;
// ------------------------------------------------------------------
/**
* Iframe widget
*
* @this {IFrameWidget}
* @constructor
* @param {String} url
*/
var IFrameWidget = function(url) {
this.element = $('<iframe src="" class="phpdebugbar-widgets-iframe" seamless="seamless" border="0" width="100%" height="100%" />');
if (url) {
this.setData(url);
}
};
/**
* Sets the iframe url
*
* @this {IFrameWidget}
* @param {String} url
*/
IFrameWidget.prototype.setUrl = function(url) {
this.element.attr('src', url);
};
// for compatibility with data mapping
IFrameWidget.prototype.setData = function(url) {
this.setUrl(url);
};
widgets.IFrameWidget = IFrameWidget;
// ------------------------------------------------------------------
// Collector specific widgets
// ------------------------------------------------------------------
/**
* Widget for the MessagesCollector
*
* Uses ListWidget under the hood
*
* @this {MessagesWidget}
* @constructor
* @param {Array} data
*/
var MessagesWidget = function(data) {
this.element = $('<div class="phpdebugbar-widgets-messages" />');
this.list = new ListWidget(null, function(li, value) {
var m = value.message;
if (m.length > 100) {
m = m.substr(0, 100) + "...";
}
var val = $('<span class="value" />').addClass(value.label).text(m).appendTo(li);
if (!value.is_string || value.message.length > 100) {
li.css('cursor', 'pointer').click(function() {
if (val.hasClass('pretty')) {
val.text(m).removeClass('pretty');
} else {
val.html(htmlize(value.message)).addClass('pretty');
}
});
}
//$('<a href="javascript:" class="backtrace"><i class="icon-code-fork"></i></a>').appendTo(li);
$('<span class="label" />').text(value.label).appendTo(li);
});
this.element.append(this.list.element);
this.toolbar = $('<div class="toolbar"><i class="icon-search"></i></div>').appendTo(this.element);
var self = this;
this.searchField = $('<input type="text" />').appendTo(this.toolbar);
this.searchField.change(function() {
self.filterData();
});
if (data) {
this.setData(data);
}
};
MessagesWidget.prototype.setData = function(data) {
this.data = data;
this.list.setData(data);
this.toolbar.find('.filter').remove();
var filters = [], self = this;
for (var i = 0; i < data.length; i++) {
if ($.inArray(data[i].label, filters) > -1) {
continue;
}
filters.push(data[i].label);
$('<a class="filter" href="javascript:" />')
.text(data[i].label)
.attr('rel', data[i].label)
.click(function() { self.toggleFilter($(this).attr('rel')); })
.appendTo(this.toolbar);
}
};
MessagesWidget.prototype.filterData = function() {
var filters = this.getEnabledFilters(),
searchStr = this.getSearchString(),
data = [];
for (var i = 0; i < this.data.length; i++) {
if ($.inArray(this.data[i].label, filters) > -1 && (!searchStr || this.data[i].message.indexOf(searchStr) > -1)) {
data.push(this.data[i]);
}
}
this.list.setData(data);
};
MessagesWidget.prototype.getSearchString = function(keywords) {
return this.toolbar.find('input').val();
};
MessagesWidget.prototype.toggleFilter = function(filter) {
this.toolbar.find('.filter[rel="' + filter + '"]').toggleClass('disabled');
this.filterData();
};
MessagesWidget.prototype.getEnabledFilters = function() {
var filters = [];
this.toolbar.find('.filter:not(.disabled)').each(function() {
filters.push(this.rel);
});
return filters;
};
MessagesWidget.prototype.clear = function() {
this.setData(this.data);
};
widgets.MessagesWidget = MessagesWidget;
// ------------------------------------------------------------------
/**
* Widget for the TimeDataCollector
*
* @this {TimelineWidget}
* @constructor
* @param {Object} data
*/
var TimelineWidget = function(data) {
this.element = $('<ul class="phpdebugbar-widgets-timeline" />');
if (data) {
this.setData(data);
}
};
TimelineWidget.prototype.setData = function(data) {
this.element.empty();
if (data.measures) {
for (var i = 0; i < data.measures.length; i++) {
var li = $('<li class="measure" />');
li.append($('<span class="label" />').text(data.measures[i].label + " (" + data.measures[i].duration_str + ")"));
li.append($('<span class="value" />').css({
left: Math.round(data.measures[i].relative_start * 100 / data.duration) + "%",
width: Math.round(data.measures[i].duration * 100 / data.duration) + "%"
}));
this.element.append(li);
}
}
};
widgets.TimelineWidget = TimelineWidget;
// ------------------------------------------------------------------
/**
* Widget for the displaying exceptions
*
* @this {ExceptionsWidget}
* @constructor
* @param {Object} data
*/
var ExceptionsWidget = function(data) {
this.element = $('<div class="phpdebugbar-widgets-exceptions" />');
this.list = new ListWidget(null, function(li, e) {
$('<span class="message" />').text(e.message).appendTo(li);
$('<span class="filename" />').text(e.file + "#" + e.line).appendTo(li);
$('<span class="type" />').text(e.type).appendTo(li);
var file = $('<div class="file" />').html(htmlize(e.surrounding_lines.join(""))).appendTo(li);
li.click(function() {
if (file.is(':visible')) {
file.hide();
} else {
file.show();
}
});
});
this.element.append(this.list.element);
if (data) {
this.setData(data);
}
};
ExceptionsWidget.prototype.setData = function(data) {
this.list.setData(data);
if (data.length == 1) {
this.list.element.children().first().find('.file').show();
}
};
widgets.ExceptionsWidget = ExceptionsWidget;
// ------------------------------------------------------------------
/**
* Widget for the displaying sql queries
*
* @this {SQLQueriesWidget}
* @constructor
* @param {Object} data
*/
var SQLQueriesWidget = function(data) {
this.element = $('<div class="phpdebugbar-widgets-sqlqueries" />');
this.status = $('<div class="status" />').appendTo(this.element);
this.list = new ListWidget(null, function(li, stmt) {
$('<span class="sql" />').text(stmt.sql).appendTo(li);
$('<span class="duration" title="Duration" />').text(stmt.duration_str).appendTo(li);
$('<span class="memory" title="Peak memory usage" />').text(stmt.memory_str).appendTo(li);
if (!stmt.is_success) {
li.addClass('error');
li.append($('<span class="error" />').text("[" + stmt.error_code + "] " + stmt.error_message));
} else if (typeof(stmt.row_count) != 'undefined') {
$('<span class="row-count" title="Row count" />').text(stmt.row_count).appendTo(li);
}
if (typeof(stmt.stmt_id) != 'undefined' && stmt.stmt_id) {
$('<span class="stmt-id" title="Prepared statement ID" />').text(stmt.stmt_id).appendTo(li);
}
});
this.element.append(this.list.element);
if (data) {
this.setData(data);
}
};
SQLQueriesWidget.prototype.setData = function(data) {
this.list.setData(data.statements);
this.status.empty()
.append($('<span />').text(data.nb_statements + " statements were executed" + (data.nb_failed_statements > 0 ? (", " + data.nb_failed_statements + " of which failed") : "")))
.append($('<span class="duration" title="Accumulated duration" />').text(data.accumulated_duration_str))
.append($('<span class="memory" title="Peak memory usage" />').text(data.peak_memory_usage_str));
};
widgets.SQLQueriesWidget = SQLQueriesWidget;
// ------------------------------------------------------------------
/**
* Widget for the displaying templates data
*
* @this {TemplatesWidget}
* @constructor
* @param {Object} data
*/
var TemplatesWidget = function(data) {
this.element = $('<div class="phpdebugbar-widgets-templates" />');
this.status = $('<div class="status" />').appendTo(this.element);
this.list = new ListWidget(null, function(li, tpl) {
$('<span class="name" />').text(tpl.name).appendTo(li);
$('<span class="render_time" title="Render time" />').text(tpl.render_time_str).appendTo(li);
});
this.element.append(this.list.element);
if (data) {
this.setData(data);
}
};
TemplatesWidget.prototype.setData = function(data) {
this.list.setData(data.templates);
this.status.empty()
.append($('<span />').text(data.templates.length + " templates were rendered"))
.append($('<span class="render_time" title="Accumulated render time" />').text(data.accumulated_render_time_str));
};
widgets.TemplatesWidget = TemplatesWidget;
// ------------------------------------------------------------------
return widgets;
})(jQuery);
|
import React, {useState, useEffect, useRef} from 'react'
import {ApiService} from '../../../services/apiService'
const Balance = () => {
let walletData;
let user;
let api;
const [wallet,setWallet] = useState([]);
async function getWallet() {
api = new ApiService();
if(await api.isLoggedin()) {
user = await api.authService.getUser();
walletData = await api.callApi('wallet/GetMyWallets');
let dataAppendString = ''
for (let index = 0; index < walletData.data.length; index++) {
dataAppendString += '<tr> <th>'+walletData.data[index].asset+'</th> <td>'+walletData.data[index].amount+'</td></tr>';
}
setWallet(<tbody dangerouslySetInnerHTML={{ __html:dataAppendString}}></tbody>);
} else {
setWallet(<tbody><tr><th className="crypt-up">Lütfen Giriş Yapın</th><th></th></tr></tbody>);
}
}
useEffect( () => {
getWallet();
return () => { };
}, []);
return (
<div className="scroller">
<table className="tablehistory">
<thead>
<tr>
<th scope="col">Varlık</th>
<th scope="col">Miktar</th>
</tr>
</thead>
{wallet}
</table>
</div>
)
}
export default Balance;
|
const twitterDecoder = (function(){
const twDomains = ["twitter.com", "mobile.twitter.com"];
const twMainSelector = '.r-rthrr5, .r-150rngu, .r-1obr2lp';
const profileSelector = '.r-1cad53l, .r-ku1wi2';
const contentSelector = '.r-779j7e, .r-1j3t67a, .r-1w50u8q.r-o7ynqc';
const twEmojiSelectors = [
{
'class': 'r-h9hxbl',
'attr': 'aria-label'
}, {
'class': 'Emoji--forText',
'attr': 'alt'
}
];
const emojiClassNames = emojiReplacer.classNames;
return {
waitForTweets,
mightContainEmoji
}
function runTranslation(root=document.body, cleanUp=true) {
if (cleanUp) {
domManipulator.clean(root);
}
extractTwitterEmojis(root);
domManipulator.start(root, false);
}
function handleAddedNodeOnTwitter(addedNode) {
// ignore changes created by this script
if (addedNode.matches(`.${emojiClassNames['helper']}`)) {
return;
}
// rescan profile node on changes
const profileNode = document.querySelector(profileSelector);
if (profileNode && profileNode.contains(addedNode)) {
runTranslation(profileNode);
}
// translate newly loaded content
const contentNodes = addedNode.querySelectorAll(contentSelector);
for (const contentNode of contentNodes) {
// skip already-translated nodes
if (!contentNode.querySelector(`.${emojiClassNames['helper']}`)) {
// only process tweets lower on page to prevent scroll jumping
// due to text reflow from translations
if (contentNode.getBoundingClientRect().bottom > 0) {
runTranslation(contentNode, false);
}
}
}
}
function handleEmbedMutations(mut, observer) {
if (mut.previousSibling.classList.contains('twitter-tweet-rendered')) {
const roots = [];
const embedNodes = document.querySelectorAll('twitter-widget');
for (const embedNode of embedNodes) {
shadowRoot = embedNode.shadowRoot;
// make changes in shadow DOM scope
runTranslation(shadowRoot, false);
shadowRoot.appendChild(buildStyleLink());
};
observer.disconnect();
return true;
}
return false;
}
function waitForTweets() {
if (twDomains.some(twDomain => document.domain === twDomain)) {
if (findTweetNode()) {
runTranslation();
}
// Continuously observe for lazy-loaded content on twitter.com
new MutationObserver((mutationsList, observer) => {
for (const mutation of mutationsList) {
const addedNode = mutation.addedNodes[0];
if (addedNode) {
handleAddedNodeOnTwitter(addedNode);
}
}
}).observe(
document.querySelector(twMainSelector),
{ childList: true, subtree:true }
);
} else {
const embedNode = document.querySelector('.twitter-tweet');
if (embedNode) {
// Wait for embedded tweets to load
new MutationObserver((mutationsList, observer) => {
for (const mutation of mutationsList) {
if (handleEmbedMutations(mutation, observer)) {
break;
}
}
}).observe(embedNode.parentNode, {childList: true});
}
}
}
function findTweetNode() {
return document.querySelector('[data-testid="tweet"]');
}
function buildStyleLink() {
const linkElem = document.createElement('link');
linkElem.setAttribute('rel', 'stylesheet');
linkElem.setAttribute('href', browser.runtime.getURL(
"emoji-to-english.css"
));
return linkElem;
}
function extractTwitterEmojis(root=document.body) {
const plainTextRE = /\w+/; // matches alphanumeric
let selectorType = 0;
// different selectors for embedded tweets
if (root.getRootNode() !== document) {
selectorType = 1;
}
const className = twEmojiSelectors[selectorType]['class'];
const attr = twEmojiSelectors[selectorType]['attr'];
const twEmojiSelector = `.${className}[${attr}]`;
const twEmojiNodes = root.querySelectorAll(twEmojiSelector);
let emojiChain = '';
for (const twEmojiNode of twEmojiNodes) {
let insertPosition = twEmojiNode;
if (selectorType === 0) {
// on twitter.com, insert after fixed-width parent node
insertPosition = twEmojiNode.parentNode;
}
let attrText = twEmojiNode.getAttribute(attr);
const hasPlainText = plainTextRE.test(attrText);
if (hasPlainText) {
attrText = emojiReplacer.wrapTranslation(attrText);
}
attrText = emojiChain + attrText;
// combine consecutive emojis for legibility
const nextNode = insertPosition.nextSibling;
if (nextNode && nextNode.querySelector &&
(nextNode.matches(twEmojiSelector) ||
nextNode.querySelector(twEmojiSelector))
) {
emojiChain = attrText;
continue;
} else {
emojiChain = '';
}
const newNode = emojiReplacer.createTranslationNode(attrText);
newNode.classList.add(emojiClassNames['helper']);
insertPosition.parentNode.insertBefore(
newNode, insertPosition.nextSibling
);
}
}
function mightContainEmoji(node) {
return node.matches('twitter-widget') ||
node.closest(`.${twEmojiSelectors[0]['class']}`) != null;
}
}());
|
/* jshint esversion: 6 */
import * as React from 'react';
import expect from 'expect';
import { configure, shallow } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import renderer from 'react-test-renderer';
import * as actions from '../actions/audioActions';
import RevertAction from '../components/controls/RevertAction';
configure({ adapter: new Adapter() })
// Snapshot for NextAction
describe('>>>Control: RevertAction --- Snapshot',()=>{
const minProps = {
id: "RevertAction",
selected: true,
strings: {
"unassign": "Unassign",
},
target: (context) => {return false;},
};
it('+++capturing Snapshot of RevertAction', () => {
const renderedValue = renderer.create(<RevertAction {...minProps}/>).toJSON()
expect(renderedValue).toMatchSnapshot();
});
});
//*******************************************************************************************************
describe('>>>Control: RevertAction', () => {
let wrapper;
const minProps = {
id: "RevertAction",
selected: true,
strings: {
"browse": "Browse",
},
target: (context) => {return false;},
};
beforeEach(()=>{
wrapper = shallow(<RevertAction {...minProps} />)
})
it('+++ renders without exploding', () => {
expect(wrapper.length).toEqual(1);
});
});
|
var React = require('react');
var Router = require('react-router');
var ReactBootstrap = require('react-bootstrap');
var $ = require('jquery');
var CityLinkList = require('./city-link-list');
var GoogleCalendar = require('./social/google-calendar');
var TwitterTimeline = require('./social/twitter-timeline');
var DevConferencesClient = require('../client/client');
var Grid = ReactBootstrap.Grid;
var Row = ReactBootstrap.Row;
var Col = ReactBootstrap.Col;
var Link = Router.Link;
var Home = React.createClass({
getInitialState: function () {
return {
cities: []
};
},
componentDidMount: function () {
DevConferencesClient.cities().then(cities => this.setState({ cities: cities.data }));
},
render: function () {
return (
<div className="container">
<div className="text-center">
Annuaire des
<abbr title="Evénements se déroulant sur un ou plusieurs jours, généralement annuellement"> conférences </abbr>
et
<abbr title="Groupes d'utilisateurs se rencontrant généralement mensuellement"> communautés </abbr>
de développeurs en France.
</div>
<Link to="search" className='btn btn-primary btn-block btn-city'>
Recherche
</Link>
<CityLinkList cities={this.state.cities}/>
<Grid>
<Row>
<Col md={8} className="text-center">
<h2>Agenda des Conférences</h2>
<p>Les dates des grandes conférences annuelles sont répertoriées ici.</p>
<div className="embed-responsive embed-responsive-4by3">
<GoogleCalendar account="devconferences.org@gmail.com"
customClass="embed-responsive-item" />
</div>
</Col>
<Col md={4} className="text-center">
<h2>Dernières infos</h2>
<p>
Via
<a href="https://twitter.com/devconferences"> @DevConferences</a>
</p>
<TwitterTimeline twitterId="devconferences" widgetId="546986135780851713" />
</Col>
</Row>
</Grid>
</div>
)
}
});
module.exports = Home;
|
// @flow
import React from 'react';
import { View, StyleSheet, Text } from 'react-native';
import {
UIColor,
UIComponent,
UIStyle,
UIActionImage,
UIUnfold,
} from '../services/UIKit';
import icoExpand from '../assets/ico-expand.png';
import icoCollapse from '../assets/ico-collapse.png';
const styles = StyleSheet.create({
//
});
type Props = {
title: string,
text: string,
};
type State = {
unfolded: boolean,
};
export default class CollapsableItem extends UIComponent<Props, State> {
constructor(props: Props) {
super(props);
this.state = {
unfolded: false,
};
}
onPress = (unfolded) => {
this.setState({
unfolded,
});
}
render() {
return (
<UIUnfold
style={UIStyle.Margin.topMedium()}
size={UIUnfold.Size.L}
titleHide={this.props.title}
titleShow={this.props.title}
unfolded={this.state.unfolded}
onPress={this.onPress}
content={
<Text style={[
UIStyle.Text.secondaryBodyRegular(),
UIStyle.Margin.topMedium(),
UIStyle.Margin.bottomDefault(),
]}
>
{this.props.text}
</Text>
}
/>
);
}
}
|
(function($) {
var members = {
private : {
create : function(options) {
var $self = $(this);
if (!$self.data('pdDialog')) {
$self.hide();
$self.addClass('pd-dialog-window');
$self.css({
'position' : 'absolute',
'left' : '50%',
'top' : '50%',
'margin-left' : - $self.width() / 2,
'margin-top' : - $self.height() / 2,
});
var $dialogHeader = $('<div class="pd-header ' +
'pd-dialog-window-header"/>');
$dialogHeader.append(options.title);
$('<span class="pd-dialog-window-titlebar-button ' +
'icon-icomoon-close"/>')
.on('click', options.onclose)
.on('click', function() {
$self.hide();
}).appendTo($dialogHeader);
var localCursorPosition = null;
$(window).on('mousedown', function(e) {
if (e.target === $dialogHeader[0] && e.which === 1) {
document.body.style.cursor = 'move';
localCursorPosition = {
x : $self.position().left - e.clientX,
y : $self.position().top - e.clientY
}
}
}).on('mouseup', function(e){
if (e.which === 1) {
document.body.style.cursor = 'default';
localCursorPosition = null;
}
}).on('mousemove', function(e) {
if (localCursorPosition && e.which === 1) {
$self.css({
left : localCursorPosition.x + e.clientX,
top : localCursorPosition.y + e.clientY
});
}
});
$dialogHeader.appendTo($self);
var $dialogContent = $('<div class="pd-dialog-window-content"/>');
$dialogContent.append(options.content);
$dialogContent.appendTo($self);
var $dialogButtons = $('<div class="pd-dialog-window-buttons"/>');
$('<span class="pd-dialog-window-button">OK</span>')
.on('click', options.onconfirm)
.on('click', function() {
$self.hide();
})
.appendTo($dialogButtons);
$('<span class="pd-dialog-window-button">Cancel</span>')
.on('click', options.oncancel)
.on('click', function() {
$self.hide();
})
.appendTo($dialogButtons);
$dialogButtons.appendTo($self);
}
return $self;
},
},
public : {
destroy : function() {
var $self = $(this);
$self.removeClass('pd-dialog-window-container');
$self.removeAttr('style');
$self.children().remove();
return $self;
},
show : function() {
$(this).show();
return $(this);
}
}
};
$.fn.pdDialog = function(method) {
if (members.public[method]) {
return members.public[method].apply(this,
Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || !method) {
return members.private.create.apply(this, arguments);
} else {
$.error('$.fn.pdDialog: Method "' + method + '" not found.');
}
};
})(jQuery);
|
'use strict';
const path = require('path');
module.exports = function (grunt) {
grunt.file.mkdir(path.join(__dirname, 'build'));
grunt.initConfig({
eslint: {
options: {
fix: true
},
target: ['lib/**/*.js']
},
mochaTest: {
test: {
options: {
reporter: 'spec',
quiet: false
},
src: ['test/**/*.js']
},
bamboo: {
options: {
reporter: 'mocha-bamboo-reporter',
quiet: false
},
src: ['<%= mochaTest.test.src %>']
}
},
'mocha_istanbul': {
coverage: {
src: 'test',
options: {
coverageFolder: 'build',
reportFormats: ['clover', 'lcov']
}
}
},
exec: {
createParser: {
cmd: './node_modules/.bin/pegjs -o pegjs-parser.js sql.pegjs'
}
},
});
require('load-grunt-tasks')(grunt);
grunt.registerTask('default', ['lint', 'test']);
grunt.registerTask('test', ['create-parser', 'mochaTest:test']);
grunt.registerTask('test-bamboo', ['create-parser', 'mochaTest:bamboo']);
grunt.registerTask('test-cov', ['create-parser', 'mocha_istanbul:coverage']);
grunt.registerTask('lint', ['eslint']);
grunt.registerTask('create-parser', 'exec:createParser');
};
|
const co = require('co')
const Tool = require('./tool')
const Sunspot = require('../models/sunspot')
class ResetConnectionsStateTool extends Tool {
runTool() {
return co(function *(){
yield Sunspot.remove({})
console.log('ALL CONNECTIONS REMOVED')
})
}
}
let tool = new ResetConnectionsStateTool()
tool.run()
|
({
getTeamsWeeksPostDataFirstTime : function(component,event,helper) {
let whichWeek = component.get("v.whichWeek");
let startDate = component.get("v.startDate");
let endDate = component.get("v.endDate");
// start showing loader
helper.showLoader(component,event,helper);
//subscribe to a channel first.
helper.subscribeToChannel(component,event,helper);
// generate weekly FeedItems data for a week, in a future context.
helper.callServer(
component,
"c.invokeMyTeamsWeeklyPostsDataFuture",
function (randomEventId) {
if (randomEventId) {
//set random event Id received at the component level.
component.set("v.randomEventId",randomEventId);
} else{
component.set("v.userMessage","Error in receiving event Id, please contact your system administrator.");
}
}, {
whichWeek: whichWeek,
startDate: startDate,
endDate: endDate
}
);
},
// Invokes the subscribe method on the empApi component.
subscribeToChannel : function(component, event, helper) {
const empApi = component.find('empApi'); // Get the empApi component
const channel = component.get("v.channel"); //Get channel details to subscribe.
const replayId = -1; // Replay option to get new events
// Subscribe to an event and process event data received.
empApi.subscribe(channel, replayId, $A.getCallback(eventReceived => {
// get random event Id
let randomEventId = component.get("v.randomEventId");
// process received event details
let weeklyTeamsPostData = eventReceived;
if(weeklyTeamsPostData.data.payload.Event_Id__c == randomEventId){
let WeeklyPostDataString = weeklyTeamsPostData.data.payload.FeedItem_Json__c;
//set weekly post data details received on component level.
helper.setWeeklyPostData(component,event,helper,WeeklyPostDataString);
//turn off flag for first time loading.
component.set("v.isFirstTimeDataLoading",false);
//time to unsubscribe channel now.
helper.unsubscribeFromChannel(component,event,helper);
}
}))
.then(subscription => {
// Save subscription to unsubscribe later
component.set('v.subscription', subscription);
});
},
getTeamsWeeksPostData : function(component,event,helper) {
let whichWeek = component.get("v.whichWeek");
let startDate = component.get("v.startDate");
let endDate = component.get("v.endDate");
// start showing loader
helper.showLoader(component,event,helper);
// fetch weekly FeedItems data for a week.
helper.callServer(
component,
"c.fetchMyTeamsWeeklyPostsData",
function (feedItemsData) {
if (feedItemsData) {
// calling helper method to build wrapper to show in datatable.
helper.buildTeamsPostDataWrapper(component, event, helper,feedItemsData);
} else{
component.set("v.userMessage","Something went wrong, please contact your system administrator");
}
}, {
whichWeek: whichWeek,
startDate: startDate,
endDate: endDate
}
);
},
buildTeamsPostDataWrapper : function(component,event,helper,feedItemsData) {
let feedItemsString = JSON.stringify(feedItemsData);
//set startDate and endDate on component level.
// component.set("v.startDate",feedItemsData.startOfWeek);
// component.set("v.endDate",feedItemsData.endOfWeek);
//call server method to build table column and rows data.
helper.callServer(
component,
"c.buildWeeklyPostDataWrapper",
function (result) {
let WeeklyPostDataString = result;
//set weekly post data details received on component level.
helper.setWeeklyPostData(component,event,helper,WeeklyPostDataString);
}, {
feedItemWrapperString: feedItemsString
}
);
},
setWeeklyPostData : function (component, event, helper, WeeklyPostDataString){
//parse JSON string to an object
let WeeklyPostData = JSON.parse(WeeklyPostDataString);
//get feedPostColumns and feedPostData values
let isCurrentWeek = WeeklyPostData.isCurrentWeek;
let startOfWeek = WeeklyPostData.startOfWeek;
let endOfWeek = WeeklyPostData.endOfWeek;
let feedPostColumns = WeeklyPostData.weeklyColumns;
let feedPostData = WeeklyPostData.weeklyPosts;
// hide loader
helper.hideLoader(component,event,helper);
if(JSON.stringify(feedPostColumns) == undefined || JSON.stringify(feedPostColumns) == '[]'){
component.set("v.userMessage","Something went wrong, please contact your system administrator.");
}
if(JSON.stringify(feedPostData) == undefined || JSON.stringify(feedPostData) == '[]'){
component.set("v.userMessage","There are no feed posts from your team in this week.");
}
// set list of columns and data to show on UI
component.set("v.isCurrentWeek",isCurrentWeek);
component.set("v.startDate",startOfWeek);
component.set("v.endDate",endOfWeek);
component.set("v.feedPostColumns", feedPostColumns);
component.set("v.feedPostData", feedPostData);
},
// Invokes the unsubscribe method on the empApi component
unsubscribeFromChannel : function(component, event, helper) {
const empApi = component.find('empApi');
const subscription = component.get('v.subscription'); // Get the subscription that we saved when subscribing
// Unsubscribe from event
empApi.unsubscribe(subscription, $A.getCallback(unsubscribed => {
// Confirm that we have unsubscribed from the event channel
component.set('v.subscription', null);
}));
},
// show spinner
showLoader : function(component, event, helper) {
let spinner = component.find("loader");
$A.util.removeClass(spinner, "slds-hide");
},
// hide spinner
hideLoader : function(component, event, helper) {
let spinner = component.find("loader");
$A.util.addClass(spinner, "slds-hide");
}
})
|
'use strict'
const pump = require('pump')
const from = require('from2')
const through = require('through2')
const csv = require('csv-write-stream')
const fs = require('fs')
const oneStationAtATime = (stations) => {
const keys = (function* (obj) {
for (let key in obj) yield key
})(stations)
return from({objectMode: true}, (size, cb) => {
const {value: key} = keys.next()
if (!key) cb(null, null)
else cb(null, stations[key])
})
}
const buildStops = (file, stations) => {
return new Promise((yay, nay) => {
pump(
oneStationAtATime(stations),
through.obj(function (station, _, cb) {
this.push({
stop_id: station.id,
// todo: stop_code
stop_name: station.name,
stop_lat: station.location.latitude,
stop_lon: station.location.longitude,
// todo: zone_id, zone_url
location_type: 1,
parent_station: '',
stop_timezone: 'Europe/Berlin'
// Even if stop_timezone values are provided in stops.txt, the times in stop_times.txt should continue to be specified as time since midnight in the timezone specified by agency_timezone in agency.txt. This ensures that the time values in a trip always increase over the course of a trip, regardless of which timezones the trip crosses.
// todo: wheelchair_boarding
})
for (let stop of station.stops) {
this.push({
stop_id: stop.id,
// todo: stop_code
stop_name: stop.name,
stop_lat: stop.location.latitude,
stop_lon: stop.location.longitude,
// todo: zone_id, zone_url
location_type: 0,
parent_station: station.id
// todo: wheelchair_boarding
})
}
cb()
}),
csv(),
fs.createWriteStream(file),
(err) => {
if (err) nay(err)
else yay()
}
)
})
}
module.exports = buildStops
|
const express = require('express')
const bodyParser = require('body-parser')
const config = require('config')
const routes = require('./routes/providers')
const app = express()
app.use(bodyParser.json())
app.use('/api/providers', routes)
app.listen(config.get('api.port'), () => console.log('Api it\'s working!'))
|
import React from 'react';
import RNBluetoothClassic from 'rn-bluetooth-classic';
import {
Container,
Text,
Header,
Left,
Button,
Icon,
Body,
Title,
Subtitle,
Right,
} from 'native-base';
import {
FlatList,
View,
StyleSheet,
TextInput,
TouchableOpacity,
} from 'react-native';
import { Buffer } from 'buffer';
/**
* Manages a selected device connection. The selected Device should
* be provided as {@code props.device}, the device will be connected
* to and processed as such.
*
* link
*/
export default class ConnectionScreen extends React.Component {
constructor(props) {
super(props);
this.state = {
text: undefined,
data: [],
polling: false,
connection: false,
connectionOptions: {
DELIMITER: '9',
},
};
}
/**
* Removes the current subscriptions and disconnects the specified
* device. It could be possible to maintain the connection across
* the application, but for now the connection is within the context
* of this screen.
*/
async componentWillUnmount() {
if (this.state.connection) {
try {
await this.props.device.disconnect();
} catch (error) {
// Unable to disconnect from device
}
}
this.uninitializeRead();
}
/**
* Attempts to connect to the provided device. Once a connection is
* made the screen will either start listening or polling for
* data based on the configuration.
*/
componentDidMount() {
setTimeout(() => this.connect(), 0);
}
async connect() {
try {
let connection = await this.props.device.isConnected();
if (!connection) {
this.addData({
data: `Attempting connection to ${this.props.device.address}`,
timestamp: new Date(),
type: 'error',
});
console.log(this.state.connectionOptions);
connection = await this.props.device.connect();
this.addData({
data: 'Connection successful',
timestamp: new Date(),
type: 'info',
});
} else {
this.addData({
data: `Connected to ${this.props.device.address}`,
timestamp: new Date(),
type: 'error',
});
}
this.setState({ connection });
this.initializeRead();
} catch (error) {
this.addData({
data: `Connection failed: ${error.message}`,
timestamp: new Date(),
type: 'error',
});
}
}
async disconnect(disconnected) {
try {
if (!disconnected) {
disconnected = await this.props.device.disconnect();
}
this.addData({
data: 'Disconnected',
timestamp: new Date(),
type: 'info',
});
this.setState({ connection: !disconnected });
} catch (error) {
this.addData({
data: `Disconnect failed: ${error.message}`,
timestamp: new Date(),
type: 'error',
});
}
// Clear the reads, so that they don't get duplicated
this.uninitializeRead();
}
initializeRead() {
this.disconnectSubscription = RNBluetoothClassic.onDeviceDisconnected(() => this.disconnect(true));
if (this.state.polling) {
this.readInterval = setInterval(() => this.performRead(), 5000);
} else {
this.readSubscription = this.props.device.onDataReceived(data =>
this.onReceivedData(data)
);
}
}
/**
* Clear the reading functionality.
*/
uninitializeRead() {
if (this.readInterval) {
clearInterval(this.readInterval);
}
if (this.readSubscription) {
this.readSubscription.remove();
}
}
async performRead() {
try {
console.log('Polling for available messages');
let available = await this.props.device.available();
console.log(`There is data available [${available}], attempting read`);
if (available > 0) {
for (let i = 0; i < available; i++) {
console.log(`reading ${i}th time`);
let data = await this.props.device.read();
console.log(`Read data ${data}`);
console.log(data);
this.onReceivedData({ data });
}
}
} catch (err) {
console.log(err);
}
}
/**
* Handles the ReadEvent by adding a timestamp and applying it to
* list of received data.
*
* @param {ReadEvent} event
*/
async onReceivedData(event) {
event.timestamp = new Date();
this.addData({
...event,
timestamp: new Date(),
type: 'receive',
});
}
async addData(message) {
this.setState({ data: [message, ...this.state.data] });
}
/**
* Attempts to send data to the connected Device. The input text is
* padded with a NEWLINE (which is required for most commands)
*/
async sendData() {
try {
console.log(`Attempting to send data ${this.state.text}`);
let message = this.state.text + '\r';
await RNBluetoothClassic.writeToDevice(
this.props.device.address,
message
);
this.addData({
timestamp: new Date(),
data: this.state.text,
type: 'sent',
});
let data = Buffer.alloc(10, 0xEF);
await this.props.device.write(data);
this.addData({
timestamp: new Date(),
data: `Byte array: ${data.toString()}`,
type: 'sent',
});
this.setState({ text: undefined });
} catch (error) {
console.log(error);
}
}
async toggleConnection() {
if (this.state.connection) {
this.disconnect();
} else {
this.connect();
}
}
render() {
let toggleIcon = this.state.connection
? 'radio-button-on'
: 'radio-button-off';
return (
<Container>
<Header iosBarStyle="light-content">
<Left>
<Button transparent onPress={this.props.onBack}>
<Icon type="Ionicons" name="arrow-back" />
</Button>
</Left>
<Body>
<Title>{this.props.device.name}</Title>
<Subtitle>{this.props.device.address}</Subtitle>
</Body>
<Right>
<Button transparent onPress={() => this.toggleConnection()}>
<Icon type="Ionicons" name={toggleIcon} />
</Button>
</Right>
</Header>
<View style={styles.connectionScreenWrapper}>
<FlatList
style={styles.connectionScreenOutput}
contentContainerStyle={{ justifyContent: 'flex-end' }}
inverted
ref="scannedDataList"
data={this.state.data}
keyExtractor={(item) => item.timestamp.toISOString()}
renderItem={({ item }) => (
<View
id={item.timestamp.toISOString()}
flexDirection={'row'} justifyContent={'flex-start'}>
<Text>{item.timestamp.toLocaleDateString()}</Text>
<Text>{item.type === 'sent' ? ' < ' : ' > '}</Text>
<Text flexShrink={1}>{item.data.trim()}</Text>
</View>
)}
/>
<InputArea
text={this.state.text}
onChangeText={text => this.setState({ text })}
onSend={() => this.sendData()}
disabled={!this.state.connection}
/>
</View>
</Container>
);
}
}
const InputArea = ({ text, onChangeText, onSend, disabled }) => {
let style = disabled ? styles.inputArea : styles.inputAreaConnected;
return (
<View style={style}>
<TextInput
style={styles.inputAreaTextInput}
placeholder={'Command/Text'}
value={text}
onChangeText={onChangeText}
autoCapitalize="none"
autoCorrect={false}
onSubmitEditing={onSend}
returnKeyType="send"
disabled={disabled}
/>
<TouchableOpacity
style={styles.inputAreaSendButton}
onPress={onSend}
disabled={disabled}>
<Text>Send</Text>
</TouchableOpacity>
</View>
);
};
/**
* TextInput and Button for sending
*/
const styles = StyleSheet.create({
connectionScreenWrapper: {
flex: 1,
},
connectionScreenOutput: {
flex: 1,
paddingHorizontal: 8,
},
inputArea: {
flexDirection: 'row',
alignContent: 'stretch',
backgroundColor: '#ccc',
paddingHorizontal: 16,
paddingVertical: 6,
},
inputAreaConnected: {
flexDirection: 'row',
alignContent: 'stretch',
backgroundColor: '#90EE90',
paddingHorizontal: 16,
paddingVertical: 6,
},
inputAreaTextInput: {
flex: 1,
height: 40,
},
inputAreaSendButton: {
justifyContent: 'center',
flexShrink: 1,
},
});
|
"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var elmnt_1 = require("elmnt");
var refluent_1 = require("refluent");
var common_1 = require("common");
var utils_1 = require("../../../utils");
var icons_1 = require("../icons");
var Item = refluent_1.default
.do('onClick', 'field', function (onClick, field) { return ({
onClick: function () { return onClick(field); },
}); })
.do(utils_1.watchHover)
.do(utils_1.restyle('relation', 'isHovered', function (relation, isHovered, style) {
return style
.mergeKeys({ item: true, relation: relation, hover: isHovered })
.merge({ border: 'none', cursor: 'pointer' });
}))
.yield(function (_a) {
var context = _a.context, type = _a.type, field = _a.field, onClick = _a.onClick, hoverProps = _a.hoverProps, style = _a.style;
return (React.createElement(elmnt_1.Txt, __assign({ onClick: onClick }, hoverProps, { style: style }), type
? context.types[type].fields.find(function (x) { return x[0] === field; })[1]
: context.types[field].name));
});
exports.default = refluent_1.default
.do(utils_1.restyle(function (style) { return (__assign({}, style, { modal: style.base
.mergeKeys('modal')
.filter('fontSize', 'background', 'padding') })); }))
.do(function (props$, _) { return ({
onMouseMove: function () {
var _a = props$(), context = _a.context, path = _a.path;
context.setActive({ type: 'add', path: path });
},
onMouseLeave: function () {
var context = props$().context;
context.setActive(null);
},
onClick: function () {
var _a = props$(), context = _a.context, path = _a.path;
context.setActive({ type: 'add', path: path }, true);
},
onClickItem: function (field) {
var _a = props$(), context = _a.context, type = _a.type, path = _a.path;
context.query.add(path, type, field);
context.setActive(null, true);
},
}); })
.do(function (props$, _) { return ({
onModalClose: function () {
if (props$().focused) {
props$().context.setActive(null, true);
return true;
}
},
}); })
.yield(function (_a) {
var context = _a.context, type = _a.type, onClickItem = _a.onClickItem, focused = _a.focused, onModalClose = _a.onModalClose, style = _a.style, next = _a.next;
return (React.createElement(elmnt_1.Modal, { isOpen: focused, onClose: onModalClose, getBase: function (_a) {
var top = _a.top, left = _a.left, height = _a.height, width = _a.width;
return ({
top: top + height,
left: left + width * 0.5 - 150,
width: 303,
});
}, style: style.modal, next: next },
React.createElement(elmnt_1.Div, { style: style.modal }, (type
? context.types[type].fields.map(function (x) { return x[0]; })
: Object.keys(context.types).sort()).map(function (f, i) { return (React.createElement(Item, { context: context, type: type, field: f, relation: f !== 'id' && (!type || common_1.root.rgo.schema[type][f].type), onClick: onClickItem, style: style.base, key: i })); }))));
})
.yield(function (_a) {
var wide = _a.wide, setModalBase = _a.setModalBase, active = _a.active, focused = _a.focused, onMouseMove = _a.onMouseMove, onMouseLeave = _a.onMouseLeave, onClick = _a.onClick, empty = _a.empty, style = _a.style;
return (React.createElement(React.Fragment, null,
(active || focused) && (React.createElement(React.Fragment, null,
React.createElement("div", { style: __assign({ position: 'absolute' }, (wide
? {
right: 0,
bottom: 0,
left: 0,
height: style.base.borderBottomWidth * 3,
}
: {
top: 0,
left: -style.base.borderLeftWidth,
bottom: 0,
width: style.base.borderLeftWidth * 3,
}), { background: !empty && style.icon.background }), ref: setModalBase }),
!empty && (React.createElement(elmnt_1.Icon, __assign({}, icons_1.default.plus, { style: __assign({}, style.icon, { position: 'absolute' }, (wide
? {
left: '50%',
marginLeft: -style.icon.radius,
bottom: style.base.borderBottomWidth,
}
: {
bottom: '50%',
left: -style.icon.radius,
marginBottom: -style.icon.radius,
})) }))))),
React.createElement("div", { onMouseMove: onMouseMove, onMouseLeave: onMouseLeave, onClick: onClick, style: {
position: 'absolute',
top: -style.icon.radius,
left: wide ? 0 : -style.base.paddingLeft,
right: wide ? 0 : -style.base.paddingRight,
bottom: 0,
cursor: 'pointer',
} })));
});
|
#!/usr/bin/env node
'use strict';
var base64 = require('../base64'),
argv = require('optimist').argv;
if (argv._[0]) {
process.stdout.write(base64(argv._[0]));
}
else {
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(data) {
process.stdout.write(base64(data.replace(/\n$/,'')));
});
}
|
import Reqwest from 'reqwest';
const key = 'P5ABZ-72QK5-V5AIG-Q6BXO-TZMZS-ZXF5Y';
class Api {
search(keyword, boundary = 'region(深圳)') {
return Reqwest({
url: 'https://apis.map.qq.com/ws/place/v1/search',
type: 'jsonp',
data: {
keyword: encodeURI(keyword),
boundary: encodeURI(boundary),
output: 'jsonp',
key
}
});
}
getPano(location) {
return Reqwest({
url: 'https://apis.map.qq.com/ws/streetview/v1/getpano',
data: {
location,
key
}
});
}
}
export default new Api();
|
/*
* Test qu'une liste {Array} contienne (ou non) un objet qui possède au moins
* les propriétés définies dans +props+.
*
* @param arr {String} Nom de la variable dans l'application (donc sans "APP")
* @param props {Object} Liste des propriétés à comparer (p.e. {id:12, class:'Fiche'})
* Toutes les propriétés doivent être égales pour que l'objet soit trouvé
* @param negatif {Boolean} Inverse la condition. Si true, l'objet ne doit pas être trouvé
* pour entrainer un succès.
*
* TODO Il faudra pouvoir faire '<arr>.should.contain.object.with(<props>)'
*/
function ArrayShouldContainObjectWith(arr, props, negatif)
{
if(undefined == negatif) negatif = false ;
var i, el, found = false ;
var arr_evaluated = eval_in_app( arr )
for(i = 0, len = arr_evaluated.length; i < len ; ++i)
{
el = arr_evaluated[i]
if( ElementInArrayHasProperties(el, props) )
{
found = true
break
}
}
var something = LOCALES['object containing'] + (inspect(props)) ;
if(found == !negatif) success(arr + (negatif ? LOCALES['doesnt contain'] : LOCALES['contains']) + something);
else failure(arr + (negatif ? LOCALES['should not contain'] : LOCALES['should contain']) + something);
}
function ElementInArrayHasProperties(el, props)
{
for(var prop in props){
if(false == props.hasOwnProperty(prop)) continue ;
if( el[prop] != props[prop] ) return false
}
return true
}
// Pour obtenir le contenu de la dernière "ligne" (div) du rapport :
Object.defineProperties(this,{
// Retourne le contenu HTML de la dernière ligne de rapport écrite
get_last_div_rapport:{
get:function(){return $('div#rapport').children().last().html()},
configurable:true
},
// Retourne les N dernières lignes du rapport
// @param nombre Le nombre de ligne remontées (à partir de la dernière)
// @param all Si true, remonte toutes les lignes, même autre que success-failure-pending
// Défaut: false
get_lasts_div_rapport:{
value:function(nombre, all){
if(undefined == all) all = false
var jid = 'div#rapport > ' +(all ? 'div' : 'div.SFP')
var lasts = []
$(jid).slice(-nombre).each(function(){
lasts.push($(this).html())
})
return lasts.reverse()
}
}
})
// Tester le retour de méthodes ou de propriétés complexes
// -------------------------------------------------------
// @param code Le code à évaluer. Par exemple "'ma_var'.is.a_number"
// @param expected Le résultat attendu (il sera évalué de façon stricte : ===)
//
// @produit Un succès si le résultat est celui escompté, un échec dans le cas contraire.
function eval_and_result(code, expected) {
res = eval(code)
if(res === expected) success("`"+code+"` renvoie bien "+tostring(expected))
else failure("`"+code+"` devrait renvoyer "+tostring(expected)+", il renvoie : "+res)
}
// --- Définition des propriétés complexes ---
//
// Donne la valeur +defaut+ à +foo+ si +foo+ est undéfini ou strictement null
function _when_undefined_or_null(foo, defaut){
if(undefined == foo || null === foo) return defaut
else return foo
}
|
import React from 'react';
import Hero from '../../sections/Hero';
import MainFeatures from '../../sections/MainFeatures';
import Banner from '../../sections/Banner';
import SmallerFeatures from '../../sections/SmallerFeatures';
import OtherProducts from '../../sections/OtherProducts';
import CallOut from '../../sections/CallOut';
const SectionsList = {
Hero: Hero,
MainFeatures: MainFeatures,
Banner: Banner,
SmallerFeatures: SmallerFeatures,
OtherProducts: OtherProducts,
CallOut: CallOut
};
const SectionRenderer = props => {
const { component, content, style } = props;
const Section = SectionsList[component];
let classNames = [];
if (component) classNames.push(component);
if (style) classNames.push(style);
return (
<section className={classNames.join(' ')}>
<Section content={content} />
</section>
);
};
export default SectionRenderer;
|
import React, {useState, useEffect} from 'react';
import { View, FlatList, Text, Image, Modal, TouchableOpacity } from 'react-native';
import firebase from 'react-native-firebase'
import FastImage from 'react-native-fast-image'
import { styles } from './styles';
import ModalStore from './ModalStore'
const ItemList = ({navigation ,propsModal, name, phone, address, picture, email, id, ativa, cnpj }) => {
function visibleModalChangeItem() {
//passLoadingTrue()
const item = {
name,
phone,
address,
picture,
email,
id,
}
propsModal(item)
}
return (
<TouchableOpacity
style={styles.containerItem}
onPress={visibleModalChangeItem}>
<View style={styles.containerImage}>
<FastImage
style={styles.picture}
source={{
uri:picture,
priority:FastImage.priority.normal,
cache:FastImage.cacheControl.immutable
}}
resizeMode={FastImage.resizeMode.cover}/>
</View>
<View style={styles.containerInfos}>
<Text style={styles.name}>{name}</Text>
<Text style={styles.phone}>{phone.tel1}</Text>
<Text style={styles.address}>
{`${address.rua}, ${address.n} - ${address.bairro}/ ${address.cidade}`}
</Text>
</View>
<View style={[styles.isActive,
!ativa && {backgroundColor:'#a51b0b'}]}/>
</TouchableOpacity>
)
}
export default function Welcome({navigation}) {
const [visibleModal, setVisibleModal] = useState(false)
const [data, setData] = useState([])
const [propsM, setPropsM] = useState(null)
useEffect(()=> {
firebase.database().ref().child('barberInfo').once('value',snapshot => {
const arr = []
if(snapshot.val()){
snapshot.forEach(snap => {
arr.push(snap.val())
})
}
setData(arr)
})
},[])
function goToMain(idStore){
navigation.navigate('Main',{id: idStore} )
}
function visibleModalChange(bool){
setVisibleModal(bool)
}
function propsModal(item){
setPropsM(item)
}
useEffect(() => {
propsM && setVisibleModal(true)
},[propsM])
return (
<View style={styles.container}>
<View style={styles.containerTxtTop}>
<Text style={styles.txtTop}>ESCOLHA A BARBEARIA</Text>
</View>
<View>
<FlatList
data={data}
keyExtractor={item => item.id}
renderItem={({ item }) =>
<ItemList
id={item.id ? item.id : 'teste id'}
picture={item.imageUrl ? item.imageUrl : null}
name={item.nome ? item.nome : 'nome teste'}
phone={item.phone ? item.phone : {}}
address={item.address ? item.address : {}}
email={item.email ? item.email : 'rrrr@eeeee.com'}
ativa={item.ativa ? item.ativa : false}
cnpj={item.cnpj ? item.cnpj : '22244455577881'}
propsModal={propsModal}
navigation={navigation}
/>}/>
</View>
<Modal
visible={visibleModal}
onRequestClose={() => visibleModalChange(false)}
transparent={true}
animationType={'slide'}
hardwareAccelerated={true}>
<ModalStore
propsM={propsM}
visibleModalChange={visibleModalChange}
goToMain={goToMain}/>
</Modal>
</View>
);
}
|
var TREE_ITEMS = [
['Verwaltung von Online-Shops', null,
['Über diese Onlinehilfe', '../../intro_about.html'],
['Einleitung', '../../ov_task.html',
['Shopmanager Überblick', '../../ov_task.html',
['Kataloge und Produkte', '../../ov_task.html#ov_task_pim'],
['Content-Management', '../../ov_task.html#ov_task_cont'],
['Online-Marketing', '../../ov_task.html#ov_task_mkt'],
['Bestellungen und Fulfillment', '../../ov_task.html#ov_task_orders'],
['Kunden Management', '../../ov_task.html#ov_task_buyer'],
['Betrieb und Wartung', '../../ov_task.html#ov_task_operMain']],
['Grundlegende Begriffe', '../../con_basic.html',
['Einleitung', '../../con_basic.html#con_basic_intro'],
['Einsatzzweck', '../../con_basic.html#con_basic_goals'],
['Akteure', '../../con_basic.html#con_basic_actors'],
['Channels und Applikationen', '../../con_basic.html#con_basic_oma'],
['Nachfrageketten', '../../con_basic.html#con_basic_demChain']],
['Arbeitsoberfläche', '../../ov_ui.html',
['Navigationselemente', '../../ov_ui.html#ov_ui_navi'],
['Dashboards ', '../../ov_ui.html#ov_ui_dash'],
['Bildschirmansichten', '../../ov_ui.html#ov_ui_views'],
['Allgemeine Schaltflächen', '../../ov_ui.html#ov_ui_btn'],
['Schnellnavigation', '../../ov_ui.html#ov_ui_quickNav'],
['Allgemeine Suchoptionen', '../../ov_ui.html#ov_ui_searchOpt']],
['HTML-Editor', '../../ov_htmledit.html',
['HTML-Editor Übersicht', '../../ov_htmledit.html#ov_htmledit_whatis'],
['HTML-Editor Image-Browser', '../../ov_htmledit.html#ov_htmleditor_img']]],
['Kataloge und Produkte', '../../buc_pim.html',
['Aktivitäten: Kataloge und Produkte', '../../buc_pim.html'],
['Katalog- und Produktverwaltung: Begriffe', '../../con_cat.html',
['Katalogtypen', '../../con_cat.html#con_cat_types'],
['Klassifikationsattribute', '../../con_cat.html#con_cat_classAttr'],
['Allgemeine Produktmerkmale', '../../con_cat.html#con_cat_features'],
['Kataloganzeigen', '../../con_cat.html#con_cat_view'],
['Eingehende Produktfreigabe', '../../con_cat.html#con_cat_inbShare'],
['Vordefinierte Produktfilter', '../../con_cat.html#con_cat_prodFlt'],
['Produktstatus', '../../con_cat.html#con_cat_prodStatus'],
['Produkt-Lebenszyklus', '../../con_cat.html#con_cat_prodLc'],
['Produktgenehmigung', '../../con_cat.html#con_cat_prodAppr'],
['SEO-Meta-Tag-Attribute', '../../con_cat.html#con_cat_seo'],
['Produktattributgruppen', '../../con_cat.html#con_cat_prag'],
['Verwaltung von Produktbildern', '../../con_cat.html#con_cat_img'],
['Preisgestaltung und Preisliste', '../../con_cat.html#con_cat_prices'],
['Netto/Brutto Preise', '../../con_cat.html#con_cat_pricesNet'],
['Produkt- und Kategoriesortierung', '../../con_cat.html#con_cat_sort'],
['Garantien und Geschenkoptionen', '../../con_cat.html#con_cat_gifts'],
['Variationen und Variationstypen', '../../con_cat.html#con_cat_vari'],
['Produktbündel und Retail-Sets', '../../con_cat.html#con_cat_bundles'],
['Kategorie- und Produktverweise', '../../con_cat.html#con_cat_links'],
['Produktzuordnung:', '../../con_cat.html#con_cat_assign'],
['Produktsuche', '../../con_cat.html#con_cat_search'],
['Produkthistorie', '../../con_cat.html#con_cat_history'],
['Papierkorb', '../../con_cat.html#con_cat_bin'],
['Produktbewertung', '../../con_cat.html#con_cat_rating'],
['Produktbenachrichtigungen', '../../con_cat.html#con_cat_noti'],
['Produktfreigaben vs. Produktsyndizierung', '../../con_cat.html#con_cat_shareSdc'],
['Katalogimport und -export', '../../con_cat.html#con_cat_impex']],
['Produktfreigaben-Verwaltung: Begriffe', '../../con_prodShare.html',
['Hauptaufgaben', '../../con_prodShare.html#con_prodShare_intro'],
['Hauptpunkte:', '../../con_prodShare.html#con_prodShare_mainCon']],
['Produktdaten-Feeds: Konzepte', '../../con_dfeed.html',
['Was sind Produktdaten-Feeds?', '../../con_dfeed.html#con_dfeed_whatis'],
['Produktdaten-Feed-Prozess', '../../con_dfeed.html#con_dfeed_wflow'],
['Ziele von Produktdaten-Feeds', '../../con_dfeed.html#con_dfeed_targets']],
['Produkt-Vollständigkeit', '../../task_pim_cmplt.html',
['Produktübersicht', '../../task_pim_cmplt.html#task_pim_cmplt_ov'],
['Produkt-Vollständigkeitsprüfung', '../../task_pim_cmplt.html#task_pim_cmplt_check']],
['Verwaltung von Standardkatalogen', '../../task_pim_cat.html',
['Kataloge anlegen', '../../task_pim_cat.html#task_pim_cat_create'],
['Kataloge bearbeiten', '../../task_pim_cat.html#task_pim_cat_edit'],
['Katalog-Channel-Zuweisungen verwalten', '../../task_pim_cat.html#task_pim_cat_assign'],
['Katalog online setzen', '../../task_pim_cat.html#task_pim_cat_setOnline'],
['Kataloge löschen', '../../task_pim_cat.html#task_pim_cat_del'],
['Katalogkategorien anlegen', '../../task_pim_cat.html#task_pim_cat_createCatCateg'],
['Katalogkategorien bearbeiten', '../../task_pim_cat.html#task_pim_cat_editCateg'],
['Katalogkategorien löschen', '../../task_pim_cat.html#task_pim_cat_deleteCatCateg'],
['Katalogkategorien kopieren', '../../task_pim_cat.html#task_pim_cat_copy'],
['Katalogkategorien publizieren', '../../task_pim_cat.html#task_pim_cat_publ'],
['Katalog-Content-Ansichten verwalten', '../../task_pim_cat.html#task_pim_cat_contView'],
['Produkte in Katalogkategorien verwalten', '../../task_pim_cat.html#task_pim_cat_catCategMgmt'],
['Produkte mithilfe von Filtern zuordnen', '../../task_pim_cat.html#task_pim_cat_flt'],
['Katalog/Kategorie-Bilder verwalten', '../../task_pim_cat.html#task_pim_cat_img'],
['SEO-Funktionen verwalten', '../../task_pim_cat.html#task_pim_cat_seo'],
['Sortierattribut verwalten', '../../task_pim_cat.html#task_pim_cat_sortAttr'],
['Manuelle Sortierung', '../../task_pim_cat.html#task_pim_cat_mnlSort'],
['Kategorie-/Produktverweise verwalten', '../../task_pim_cat.html#task_pim_cat_links']],
['Verwaltung von Klassifikationskatalogen', '../../task_pim_catClass.html',
['Klassifikationskatalog anlegen', '../../task_pim_catClass.html#task_pim_catClass_create'],
['Klassifikationskatalog bearbeiten', '../../task_pim_catClass.html#task_pim_catClass_editClassCat'],
['Klassifikationskatalog online stellen', '../../task_pim_catClass.html#task_pim_catClass_set'],
['Klassifikationskatalog löschen', '../../task_pim_catClass.html#task_pim_catClass_del'],
['eCl@ss- oder UN/SPSC-Kategorien anzeigen', '../../task_pim_catClass.html#task_pim_catClass_view'],
['Klassifikationskatalog-Kategorien anlegen', '../../task_pim_catClass.html#task_pim_catClass_createCateg'],
['Klassifikationskatalog-Kategorien bearbeiten', '../../task_pim_catClass.html#task_pim_catClass_editCateg'],
['Klassifikationskatalog-Kategorien löschen', '../../task_pim_catClass.html#task_pim_catClass_deleteCateg'],
['Klassifikationskatalog-Kategorien kopieren', '../../task_pim_catClass.html#task_pim_catClass_copy'],
['Klassifikationsattribute verwalten', '../../task_pim_catClass.html#task_pim_catClass_classAttr'],
['Sortierattribute verwalten', '../../task_pim_catClass.html#task_pim_catClass_sortAttr'],
['Kategorie-/Produktverweise verwalten', '../../task_pim_catClass.html#task_pim_catClass_links']],
['Verwaltung von Kataloganzeigen', '../../task_pim_catView.html',
['Kataloganzeige erstellen', '../../task_pim_catView.html#task_pim_catView_create'],
['Kataloganzeige bearbeiten', '../../task_pim_catView.html#task_pim_catView_edit'],
['Kataloge in Kataloganzeigen aufnehmen', '../../task_pim_catView.html#task_pim_catView_incl'],
['Aus Kataloganzeigen ausblenden', '../../task_pim_catView.html#task_pim_catView_excl'],
['Kataloganzeigen Kunden zuordnen', '../../task_pim_catView.html#task_pim_catView_assign'],
['Zuordnung zu Kunden aufheben', '../../task_pim_catView.html#task_pim_catView_unassign'],
['Kataloganzeigen publizieren', '../../task_pim_catView.html#task_pim_catView_publ'],
['Kataloganzeige löschen', '../../task_pim_catView.html#task_pim_catView_del']],
['Produktfilter verwalten', '../../task_pim_flt.html',
['Ein Produktfilter anlegen', '../../task_pim_flt.html#task_pim_flt_create'],
['Produktfilter-Regeln bearbeiten', '../../task_pim_flt.html#task_pim_flt_edit'],
['Produktfilter löschen', '../../task_pim_flt.html#task_pim_flt_del']],
['Produktverwaltung', '../../task_pim_mgmt.html',
['Produkte finden', '../../task_pim_mgmt.html#task_pim_mgmt_locate'],
['Ein Produkt anlegen', '../../task_pim_mgmt.html#task_pim_mgmt_create'],
['Standard-Produktattribute', '../../task_pim_mgmt.html#task_pim_mgmt_prodAttr'],
['Produkte sperren', '../../task_pim_mgmt.html#task_pim_mgmt_lock'],
['Produktvorschau', '../../task_pim_mgmt.html#task_pim_mgmt_preview'],
['Produkt-Onlinestatus einstellen', '../../task_pim_mgmt.html#task_pim_mgmt_status'],
['Produktgenehmigungen verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_appr'],
['Produkte bearbeiten', '../../task_pim_mgmt.html#task_pim_mgmt_editProd'],
['Produktbilder bearbeiten', '../../task_pim_mgmt.html#task_pim_mgmt_editImage'],
['Katalogkategorie-Zuordnungen verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_categ'],
['Produkte in Stapelprozessen bearbeiten', '../../task_pim_mgmt.html#task_pim_mgmt_batch'],
['Produkte publizieren', '../../task_pim_mgmt.html#task_pim_mgmt_publ'],
['Produkte werden gelöscht', '../../task_pim_mgmt.html#task_pim_mgmt_del'],
['Produkte aus dem Papierkorb wiederherstellen', '../../task_pim_mgmt.html#task_pim_mgmt_restore'],
['Produktattributgruppen verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_prag'],
['Produkte werden kopiert', '../../task_pim_mgmt.html#task_pim_mgmt_copy'],
['Produkt-Content-Ansichten verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_prodContView'],
['Produkt-Lebenszyklus verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_prodLc'],
['Schlagwörter-Suchindex verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_ind'],
['SEO-Attribute für Produktseiten verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_seoAttr'],
['Produkt-Master Detailseite', '../../task_pim_mgmt.html#task_pim_mgmt_master'],
['Produktvariationen verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_vari'],
['Variationsprodukt-Sortierung verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_variSort'],
['Produktvariationstypen verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_variTypes'],
['Variationsprodukte erzeugen', '../../task_pim_mgmt.html#task_pim_mgmt_variProd_create'],
['Produktbündel verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_bundle'],
['Retail-Sets verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_retail'],
['Produktanlagen verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_attach'],
['Kategorie-/Produktverweise verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_link'],
['Garantieoptionen verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_warranty'],
['Geschenkoptionen verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_gift'],
['Label verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_label'],
['Klassifikationen verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_class'],
['Preislisten verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_priceList'],
['Produkt-Listenpreise und Einstandspreise verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_listCost'],
['Staffelpreise verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_scaledPrice'],
['Produkthistorie anzeigen', '../../task_pim_mgmt.html#task_pim_mgmt_history'],
['Produktbewertungen verwalten', '../../task_pim_mgmt.html#task_pim_mgmt_rating']],
['Produktbilder verwalten', '../../task_pim_images.html',
['Bilddateien hochladen', '../../task_pim_images.html#task_pim_images_upl'],
['Bildanzeigen verwalten', '../../task_pim_images.html#task_pim_images_views'],
['Bildtypen verwalten', '../../task_pim_images.html#task_pim_images_types'],
['Bildsets verwalten', '../../task_pim_images.html#task_pim_images_sets']],
['Produktfreigaben-Verwaltung', '../../task_pim_share.html',
['Channel-Zuordnungen verwalten', '../../task_pim_share.html#task_pim_share_ch'],
['Produktdaten-Zuordnungen verwalten', '../../task_pim_share.html#task_pim_share_assign'],
['Freigabe-Gruppen verwalten', '../../task_pim_share.html#task_pim_share_grps']],
['Verwaltung von Hersteller-Aliassen', '../../task_pim_alias.html',
['Hersteller-Aliasse verwalten', '../../task_pim_alias.html#task_pim_alias_manuf'],
['Hersteller-Zuordnungen verwalten', '../../task_pim_alias.html#task_pim_alias_assign']],
['Eingehende Produktfreigabe verwalten', '../../task_pim_inbShare.html',
['Alle freigegebenen Produkte aktivieren', '../../task_pim_inbShare.html#task_pim_inbShare_all'],
['Ausgewählte freigegebene Produkte aktivieren', '../../task_pim_inbShare.html#task_pim_inbShare_select'],
['Ausgewählte geteilte Produkte deaktivieren', '../../task_pim_inbShare.html#task_pim_inbShare_deactivate']],
['Produktdaten-Feeds verwalten', '../../task_pim_dfeed.html',
['Neue Konfiguration erzeugen', '../../task_pim_dfeed.html#task_pim_dfeed_config'],
['Produkte suchen und zuordnen', '../../task_pim_dfeed.html#task_pim_dfeed_search'],
['Produkte durchsuchen und zuordnen', '../../task_pim_dfeed.html#task_pim_dfeed_browse'],
['Attributzuordnungsregeln bearbeiten', '../../task_pim_dfeed.html#task_pim_dfeed_mapping'],
['Produktdaten-Feeds manuell ausführen', '../../task_pim_dfeed.html#task_pim_dfeed_runMnl'],
['Produktdaten-Feeds automatisch ausführen', '../../task_pim_dfeed.html#task_pim_dfeed_runAuto']],
['Katalogimport und -export', '../../task_pim_impex.html',
['Import/Export statische Datei', '../../task_pim_impex.html#task_pim_impex_static'],
['Import/Export von Katalog-/Produktdaten', '../../task_pim_impex.html#task_pim_impex_cat'],
['Preislisten exportieren/importieren', '../../task_pim_impex.html#task_pim_impex_lists'],
['Bild-Metadaten exportieren/importieren', '../../task_pim_impex.html#task_pim_impex_imageMeta']],
['Katalog- und Produkteinstellungen', '../../task_pref_pim.html',
['Papierkorb und Produktlöschung verwalten', '../../task_pref_pim.html#task_pref_pim_bin'],
['Produkthistorie aktivieren', '../../task_pref_pim.html#task_pref_pim_history'],
['Produktsperren verwalten', '../../task_pref_pim.html#task_pref_pim_lock'],
['Sortierungs-Einstellungen verwalten', '../../task_pref_pim.html#task_pref_pim_sort'],
['HTML-Bearbeitung aktivieren', '../../task_pref_pim.html#task_pref_pim_html'],
['Produktgenehmigung aktivieren', '../../task_pref_pim.html#task_pref_pim_prodAppr']]],
['Content-Management', '../../buc_cont.html',
['Aktivitäten: Content-Management', '../../buc_cont.html'],
['Content-Management: Begriffe', '../../con_page.html',
['Content-Elemente', '../../con_page.html#con_page_assets'],
['Content-Templates', '../../con_page.html#con_page_tmpl'],
['Rollen und Aufgaben', '../../con_page.html#con_page_roles'],
['Verwalten von Content-Elementen', '../../con_page.html#con_page_asset'],
['Storefront Design-Ansicht', '../../con_page.html#con_page_sfView']],
['Content-Übersicht', '../../task_page_cont.html',
['Content-Übersicht', '../../task_page_cont.html#task_page_cont_ov'],
['Content-Vollständigkeit', '../../task_page_cont.html#task_page_cont_cmplt']],
['Verwaltung von Seiten', '../../task_page_mgmt.html',
['Seiten anzeigen', '../../task_page_mgmt.html#task_page_mgmt_view'],
['Seiten suchen', '../../task_page_mgmt.html#task_page_mgmt_search'],
['Seiten erstellen', '../../task_page_mgmt.html#task_page_mgmt_create'],
['Seiten sperren', '../../task_page_mgmt.html#task_page_mgmt_lock'],
['Seiten bearbeiten', '../../task_page_mgmt.html#task_page_mgmt_edit'],
['Seitenhierarchie bearbeiten', '../../task_page_mgmt.html#task_page_mgmt_hier'],
['Seitenvarianten zu Seite hinzufügen', '../../task_page_mgmt.html#task_page_mgmt_vrnt'],
['Seiten-Label verwalten', '../../task_page_mgmt.html#task_page_mgmt_label'],
['Seiten in Stapelprozessen bearbeiten', '../../task_page_mgmt.html#task_page_mgmt_batch'],
['Publikationsseiten', '../../task_page_mgmt.html#task_page_mgmt_publ']],
['Verwaltung von Seitenvarianten', '../../task_page_vrnt.html',
['Seitenvarianten Anzeigen', '../../task_page_vrnt.html#task_page_vrnt_view'],
['Seitenvarianten suchen', '../../task_page_vrnt.html#task_page_vrnt_search'],
['Seitenvarianten erzeugen', '../../task_page_vrnt.html#task_page_vrnt_create'],
['Seitenvarianten sperren', '../../task_page_vrnt.html#task_page_vrnt_lock'],
['Seitenvarianten bearbeiten', '../../task_page_vrnt.html#task_page_vrnt_edit'],
['Komponenten zu Seite hinzufügen', '../../task_page_vrnt.html#task_page_vrnt_cmp'],
['Seitenvarianten-Zuordnungen verwalten', '../../task_page_vrnt.html#task_page_vrnt_assignm'],
['Publikationseinstellungen für Seitenvarianten festlegen', '../../task_page_vrnt.html#task_page_vrnt_pubprop'],
['Seitenvarianten-Label verwalten', '../../task_page_vrnt.html#task_page_vrnt_label'],
['Seitenvarianten in Stapelprozessen bearbeiten', '../../task_page_vrnt.html#task_page_vrnt_batch'],
['Seitenvarianten publizieren', '../../task_page_vrnt.html#task_page_vrnt_publ']],
['Komponenten-Verwaltung', '../../task_page_cmp.html',
['Komponenten Anzeigen', '../../task_page_cmp.html#task_page_cmp_view'],
['Verfügbare Komponententypen anzeigen', '../../task_page_cmp.html#task_page_cmp_type'],
['Komponenten suchen', '../../task_page_cmp.html#task_page_cmp_search'],
['Komponenten erstellen', '../../task_page_cmp.html#task_page_cmp_create'],
['Komponenten sperren', '../../task_page_cmp.html#task_page_cmp_lock'],
['Komponenten bearbeiten', '../../task_page_cmp.html#task_page_cmp_edit'],
['Komponenten-Zuordnungen verwalten', '../../task_page_cmp.html#task_page_cmp_assign'],
['Komponenten-Publikationseinstellungen festlegen', '../../task_page_cmp.html#task_page_cmp_prop'],
['Komponenten-Label verwalten', '../../task_page_cmp.html#task_page_cmp_label'],
['Komponenten in Stapelprozessen bearbeiten', '../../task_page_cmp.html#task_page_cmp_batch'],
['Komponenten publizieren', '../../task_page_cmp.html#task_page_cmp_publ'],
['Verwalten von Komponenten per Drag & Drop', '../../task_page_cmp.html#task_page_cmp_DragAndDrop']],
['Include-Verwaltung', '../../task_page_incl.html',
['Includes Anzeigen', '../../task_page_incl.html#task_page_incl_view'],
['Includes suchen', '../../task_page_incl.html#task_page_incl_search'],
['Includes sperren', '../../task_page_incl.html#task_page_incl_lock'],
['Includes bearbeiten', '../../task_page_incl.html#task_page_incl_edit'],
['Komponenten zu Includes hinzufügen', '../../task_page_incl.html#task_page_incl_cmp'],
['Include-Label verwalten', '../../task_page_incl.html#task_page_incl_label'],
['Includes in Stapelprozessen bearbeiten', '../../task_page_incl.html#task_page_incl_batch'],
['Includes publizieren', '../../task_page_incl.html#task_page_incl_publ']],
['Verwaltung von Ansichtskontexten', '../../task_page_ctxt.html',
['Ansichtskontexte Anzeigen', '../../task_page_ctxt.html#task_page_ctxt_view'],
['Ansichtskontexte suchen', '../../task_page_ctxt.html#task_page_ctxt_search'],
['Ansichtskontexte erstellen', '../../task_page_ctxt.html#task_page_ctxt_create'],
['Ansichtskontexte sperren', '../../task_page_ctxt.html#task_page_ctxt_lock'],
['Ansichtskontexte bearbeiten', '../../task_page_ctxt.html#task_page_ctxt_edit'],
['Ansichtskontext-Zuordnungen verwalten', '../../task_page_ctxt.html#task_page_ctxt_assign'],
['Ansichtskontexte publizieren', '../../task_page_ctxt.html#task_page_ctxt_publ']],
['Verwaltung von Seiten-Templates', '../../task_page_tmpl.html',
['Seiten-Templates Anzeigen', '../../task_page_tmpl.html#task_page_tmpl_view'],
['Seiten-Templates suchen', '../../task_page_tmpl.html#task_page_tmpl_search'],
['Seiten-Templates erstellen', '../../task_page_tmpl.html#task_page_tmpl_create'],
['Seiten-Templates sperren', '../../task_page_tmpl.html#task_page_tmpl_lock'],
['Seiten-Templates bearbeiten', '../../task_page_tmpl.html#task_page_tmpl_edit'],
['Content zu Seiten-Templates hinzufügen', '../../task_page_tmpl.html#task_page_tmpl_cmp'],
['Platzhalter verwalten', '../../task_page_tmpl.html#task_page_tmpl_ph'],
['Seiten-Template-Label verwalten', '../../task_page_tmpl.html#task_page_tmpl_label'],
['Seiten-Templates publizieren', '../../task_page_tmpl.html#task_page_tmpl_publ']],
['Verwaltung von Komponenten-Templates', '../../task_page_cmpTmpl.html',
['Komponenten-Templates Anzeigen', '../../task_page_cmpTmpl.html#task_page_cmpTmpl_view'],
['Komponenten-Templates suchen', '../../task_page_cmpTmpl.html#task_page_cmpTmpl_search'],
['Komponenten-Templates erstellen', '../../task_page_cmpTmpl.html#task_page_cmpTmpl_create'],
['Komponenten-Templates sperren', '../../task_page_cmpTmpl.html#task_page_cmpTmpl_lock'],
['Komponenten-Templates bearbeiten', '../../task_page_cmpTmpl.html#task_page_cmpTmpl_edit'],
['Content zu Komponenten-Templates hinzufügen', '../../task_page_cmpTmpl.html#task_page_cmpTmpl_comp'],
['Platzhalter verwalten', '../../task_page_cmpTmpl.html#task_page_cmpTmpl_ph'],
['Komponenten-Template-Label verwalten', '../../task_page_cmpTmpl.html#task_page_cmpTmpl_label'],
['Komponenten-Templates publizieren', '../../task_page_cmpTmpl.html#task_page_cmpTmpl_publ']],
['Freigaben von Content-Elementen', '../../task_page_share.html',
['Freigabebeziehung anlegen', '../../task_page_share.html#task_page_share_create'],
['Freigabebeziehung aufheben', '../../task_page_share.html#task_page_share_remove'],
['Steuern von Änderungen an freigegebenem Content', '../../task_page_share.html#task_page_share_mod']],
['Storefront-Content bearbeiten', '../../task_page_sf.html',
['Standard-Vorschau-Applikation festlegen', '../../task_page_sf.html#task_page_sf_app'],
['Design-Ansicht starten', '../../task_page_sf.html#task_page_sf_launch'],
['Auf Content-Elemente zugreifen', '../../task_page_sf.html#task_page_sf_access'],
['Content-Elemente bearbeiten', '../../task_page_sf.html#task_page_sf_edit']],
['Import und Export von Content-Elementen', '../../task_content_impex.html',
['Upload von Importdateien', '../../task_content_impex.html#task_content_impex_upl'],
['Download von Export-Dateien', '../../task_content_impex.html#task_content_impex_dl'],
['Content-Elemente exportieren', '../../task_content_impex.html#task_content_impex_exp'],
['Content-Elemente importieren', '../../task_content_impex.html#task_content_impex_imp'],
['Applikations-Content vorbereiten', '../../task_content_impex.html#task_content_impex_prepare']],
['Verwaltung von Landing-Pages', '../../task_page_land.html',
['Landing-Page-Verzeichnisse verwalten', '../../task_page_land.html#task_page_land_dir'],
['Landing-Page-Dateien verwalten', '../../task_page_land.html#task_page_land_file']]],
['Online-Marketing', '../../buc_mkt.html',
['Aktivitäten: Online-Marketing', '../../buc_mkt.html',
['Aktionen und Kampagnen', '../../buc_mkt.html#buc_mkt_promo'],
['Suchmaschinenoptimierung ', '../../buc_mkt.html#buc_mkt_seo'],
['Weitere Marketing-Aktivitäten', '../../buc_mkt.html#buc_mkt_misc']],
['Online-Marketing-Verwaltung: Begriffe', '../../con_mkt.html',
['Übersicht', '../../con_mkt.html#con_mkt_wflow'],
['Aktionen und Kampagnen', '../../con_mkt.html#con_mkt_promo'],
['Geschenkkarten und Geschenkgutscheine', '../../con_mkt.html#con_mkt_giftCards'],
['A/B-Tests', '../../con_mkt.html#con_mkt_abtest'],
['Affiliate-Partner', '../../con_mkt.html#con_mkt_afm'],
['Suchmaschinenoptimierung ', '../../con_mkt.html#con_mkt_seo'],
['Kurz-URLs und URL-Weiterleitung', '../../con_mkt.html#con_mkt_slink'],
['Produktdaten-Feeds', '../../con_mkt.html#con_mkt_dfeed'],
['Landing-Pages', '../../con_mkt.html#con_mkt_land'],
['E-Mail-Marketing', '../../con_mkt.html#con_mkt_emm']],
['Kampagnenverwaltung', '../../task_mkt_promo.html',
['Aktionsübersicht', '../../task_mkt_promo.html#task_mkt_promo_ov'],
['Aktionen anzeigen', '../../task_mkt_promo.html#task_mkt_promo_view'],
['Aktionsvorschau', '../../task_mkt_promo.html#task_mkt_promo_preview'],
['Aktionen anlegen', '../../task_mkt_promo.html#task_mkt_promo_create'],
['Verwaltung von Aktionsdetails', '../../task_mkt_promo.html#task_mkt_promo_detail'],
['Aktionen veröffentlichen', '../../task_mkt_promo.html#task_mkt_promo_release'],
['Publizieren von Aktionen', '../../task_mkt_promo.html#task_mkt_promo_publ'],
['Ziele einer Aktion festlegen', '../../task_mkt_promo.html#task_mkt_promo_target'],
['Verwaltung von Aktionscodes', '../../task_mkt_promo.html#task_mkt_promo_code'],
['Rabattregeln festlegen', '../../task_mkt_promo.html#task_mkt_promo_rules'],
['Konfiguration von Aktions-Mitteilungen', '../../task_mkt_promo.html#task_mkt_promo_msg'],
['Content-Beziehungen für Aktionen verwalten', '../../task_mkt_promo.html#task_mkt_promo_cont'],
['Aktionsanlagen hochladen', '../../task_mkt_promo.html#task_mkt_promo_attach'],
['Aktionen in Stapelprozessen bearbeiten', '../../task_mkt_promo.html#task_mkt_promo_batch']],
['Kampagnenmanagement ', '../../task_mkt_cmpgs.html',
['Kampagnen anzeigen ', '../../task_mkt_cmpgs.html#task_mkt_cmpgs_view'],
['Kampagnen publizieren ', '../../task_mkt_cmpgs.html#task_mkt_cmpgs_publ'],
['Kampagnen erstellen ', '../../task_mkt_cmpgs.html#task_mkt_cmpgs_create'],
['Aktionen zu Kampagnen zuordnen', '../../task_mkt_cmpgs.html#task_mkt_cmpgs_promo'],
['Content zu Kampagnen zuordnen ', '../../task_mkt_cmpgs.html#task_mkt_cmpgs_cont'],
['Ziele einer Kampagne festlegen ', '../../task_mkt_cmpgs.html#task_mkt_cmpgs_target']],
['Verwaltung von A/B-Tests', '../../task_mkt_abtest.html',
['A/B-Tests anzeigen ', '../../task_mkt_abtest.html#task_mkt_abtest_view'],
['A/B-Tests anlegen ', '../../task_mkt_abtest.html#task_mkt_abtest_create'],
['A/B-Test aktivieren', '../../task_mkt_abtest.html#task_mkt_abtest_release'],
['Deaktivierung A/B-Test ', '../../task_mkt_abtest.html#task_mkt_abtest_disable'],
['Löschen von A/B-Tests ', '../../task_mkt_abtest.html#task_mkt_abtest_del'],
['Zielgruppe verwalten ', '../../task_mkt_abtest.html#task_mkt_abtest_target'],
['Testgruppen verwalten ', '../../task_mkt_abtest.html#task_mkt_abtest_testGrps'],
['Test-Content verwalten ', '../../task_mkt_abtest.html#task_mkt_abtest_testCont'],
['A/B-Test-Ergebnisse anzeigen', '../../task_mkt_abtest.html#task_mkt_abtest_result']],
['Verwaltung von Geschenkkarten & -gutscheinen ', '../../task_mkt_gifts.html',
['Geschenkkarten & -gutscheine anzeigen', '../../task_mkt_gifts.html#task_mkt_gifts_view'],
['Geschenkkarte/-gutschein deaktivieren ', '../../task_mkt_gifts.html#task_mkt_gifts_disable'],
['Geschenkkarte/-gutschein löschen ', '../../task_mkt_gifts.html#task_mkt_gifts_del'],
['Geschenkkarten/-gutschein-Transaktionen anzeigen ', '../../task_mkt_gifts.html#task_mkt_gifts_viewTrans'],
['Geschenkkarten-/Geschenkgutschein-Einstellungen verwalten ', '../../task_mkt_gifts.html#task_mkt_gifts_pref']],
['Affiliate-Partner-Verwaltung ', '../../task_mkt_afm.html',
['Affiliate-Partner anlegen ', '../../task_mkt_afm.html#task_mkt_afm_create'],
['Affiliate-Partner löschen ', '../../task_mkt_afm.html#task_mkt_afm_del'],
['Anlegen von Programmen für Affiliate-Partner ', '../../task_mkt_afm.html#task_mkt_afm_createProgram'],
['Programme von Affiliate-Partnern löschen ', '../../task_mkt_afm.html#task_mkt_afm_delProgram'],
['Anzeige von Zugriffsstatistiken ', '../../task_mkt_afm.html#task_mkt_afm_stat']],
['Empfehlungs-Datenfeed', '../../task_mdata_recomm.html',
['Neue Konfiguration erzeugen', '../../task_mdata_recomm.html#task_mdata_recomm_create'],
['Empfehlungs-Datenfeed manuell ausführen', '../../task_mdata_recomm.html#task_mdata_recomm_runMnl'],
['Empfehlungs-Datenfeed automatisch ausführen', '../../task_mdata_recomm.html#task_mdata_recomm_runAuto']],
['Aktionsdaten-Import und -Export ', '../../task_mkt_promoImpex.html',
['Upload von Importdateien ', '../../task_mkt_promoImpex.html#task_mkt_promoImpex_upl'],
['Download von Export-Dateien', '../../task_mkt_promoImpex.html#task_mkt_promoImpex_dl'],
['Aktionen importieren', '../../task_mkt_promoImpex.html#task_mkt_promoImpex_imp'],
['Aktionen exportieren', '../../task_mkt_promoImpex.html#task_mkt_promoImpex_exp'],
['Aktionscodes importieren ', '../../task_mkt_promoImpex.html#task_mkt_promoImpex_impCode'],
['Aktionscodes exportieren ', '../../task_mkt_promoImpex.html#task_mkt_promoImpex_expCode'],
['Aktionscode-Gruppen importieren', '../../task_mkt_promoImpex.html#task_mkt_promoImpex_impCodeGrp'],
['Aktionscode-Gruppen exportieren', '../../task_mkt_promoImpex.html#task_mkt_promoImpex_expCodeGrp']],
['Kurz-URL-Verwaltung ', '../../task_mkt_slink.html',
['Kurz-URLs anzeigen ', '../../task_mkt_slink.html#task_mkt_slink_view'],
['Kurz-URLs anlegen ', '../../task_mkt_slink.html#task_mkt_slink_create'],
['Kurz-URLs bearbeiten ', '../../task_mkt_slink.html#task_mkt_slink_edit'],
['Löschen von Kurz-URLs ', '../../task_mkt_slink.html#task_mkt_slink_del'],
['URL-Gruppen erstellen ', '../../task_mkt_slink.html#task_mkt_slink_createGrps'],
['Kurz-URLs zu URL-Gruppen zuordnen ', '../../task_mkt_slink.html#task_mkt_slink_assign'],
['URLs oder URL-Gruppen exportieren', '../../task_mkt_slink.html#task_mkt_slink_exp']],
['Kurz-URL-Import und -Export ', '../../task_mkt_slinkImpex.html',
['Upload von Importdateien ', '../../task_mkt_slinkImpex.html#task_mkt_slinkImpex_upl'],
['Download von Export-Dateien ', '../../task_mkt_slinkImpex.html#task_mkt_slinkImpex_dl'],
['URLs exportieren ', '../../task_mkt_slinkImpex.html#task_mkt_slinkImpex_exp'],
['Export von Kurz-URLs (CSV) ', '../../task_mkt_slinkImpex.html#task_mkt_slinkImpex_expSlink'],
['Import von Kurz-URLs ', '../../task_mkt_slinkImpex.html#task_mkt_slinkImpex_imp']]],
['Bestellungen und Fulfillment', '../../buc_order.html',
['Aktivitäten: Bestellungen und Fulfillment', '../../buc_order.html',
['Abwicklung von Bestellungen und Preisangeboten', '../../buc_order.html#buc_order_proc'],
['Bestelloptionen verwalten', '../../buc_order.html#buc_order_opt']],
['Bestellungsverwaltung: Begriffe', '../../con_order.html',
['Übersicht über den Bestellprozess', '../../con_order.html#con_order_wflow'],
['Allgemeine Bestellungsverwaltung', '../../con_order.html#con_order_mgmt'],
['Bestellungssuche', '../../con_order.html#con_order_search'],
['Bestellverfolgung', '../../con_order.html#con_order_track'],
['Bestellungsexport und -import', '../../con_order.html#con_order_impex'],
['Versandkonfiguration', '../../con_order.html#con_order_ship'],
['Ausgeschlossene Lieferdaten', '../../con_order.html#con_order_shipDate'],
['Preisangebote', '../../con_order.html#con_order_quote']],
['Zahlungsarten', '../../con_pay.html',
['Handhabung von Zahlungsarten', '../../con_pay.html#con_pay_handle'],
['Allgemeine Zahlungsverarbeitung', '../../con_pay.html#con_pay_proc']],
['Bestellungsverwaltung', '../../task_order_mgmt.html',
['Bestellübersicht', '../../task_order_mgmt.html#task_order_mgmt_ov'],
['Bestellungen anzeigen', '../../task_order_mgmt.html#task_order_mgmt_view'],
['Bestellungen suchen', '../../task_order_mgmt.html#task_order_mgmt_search'],
['Bestell-/Artikeldetails', '../../task_order_mgmt.html#task_order_mgmt_details'],
['Bestell-Aktionen anzeigen', '../../task_order_mgmt.html#task_order_mgmt_promo'],
['Zahlungsdetails anzeigen', '../../task_order_mgmt.html#task_order_mgmt_pay']],
['Versandkonfigurationen verwalten', '../../task_order_ship.html',
['Versandarten verwalten', '../../task_order_ship.html#task_order_ship_method'],
['Zielortregionen verwalten', '../../task_order_ship.html#task_order_ship_region'],
['Frachtklassen verwalten', '../../task_order_ship.html#task_order_ship_freight'],
['Versandregeln verwalten', '../../task_order_ship.html#task_order_ship_rules'],
['Ausgeschlossene Liefertermine anzeigen', '../../task_order_ship.html#task_order_ship_datesView'],
['Ausgeschlossene Liefertermine verwalten', '../../task_order_ship.html#task_order_ship_datesMgmt']],
['Verwalten von Zahlungsarten', '../../task_order_pay.html',
['Zahlungsart-Konfigurationen anlegen', '../../task_order_pay.html#task_order_pay_create'],
['Zahlungsart-Konfigurationen bearbeiten', '../../task_order_pay.html#task_order_pay_edit'],
['Zahlungsart-Konfigurationen sortieren', '../../task_order_pay.html#task_order_pay_sort'],
['Zahlungsart-Konfigurationen löschen', '../../task_order_pay.html#task_order_pay_del']],
['Bestellungsexport/-import', '../../task_order_impex.html',
['Neue Konfigurationen anlegen', '../../task_order_impex.html#task_order_impex_create'],
['Manuelle Export-/Import-Vorgänge', '../../task_order_impex.html#task_order_impex_runMnl'],
['Automatische Export-/Import-Vorgänge', '../../task_order_impex.html#task_order_impex_runAuto']],
['Versanddaten-Import und -Export', '../../task_order_shipImpex.html',
['Upload von Importdateien', '../../task_order_shipImpex.html#task_order_shipImpex_upl'],
['Download von Export-Dateien', '../../task_order_shipImpex.html#task_order_shipImpex_dl'],
['Versanddaten exportieren', '../../task_order_shipImpex.html#task_order_shipImpex_exp'],
['Versanddaten importieren', '../../task_order_shipImpex.html#task_order_shipImpex_imp']],
['Verwaltung von Preisangeboten', '../../task_order_quote.html',
['Alle Preisangebote anzeigen', '../../task_order_quote.html#task_order_quote_view'],
['Preisangebote suchen', '../../task_order_quote.html#task_order_quote_search'],
['Preisangebot-Details bearbeiten', '../../task_order_quote.html#task_order_quote_edit'],
['Preisangebote absenden', '../../task_order_quote.html#task_order_quote_submit']]],
['Kunden-Management', '../../buc_buyer.html',
['Aktivitäten: Kundenverwaltung', '../../buc_buyer.html',
['Kunden verwalten', '../../buc_buyer.html#buc_buyer_mgmt'],
['Kundensegmente verwalten', '../../buc_buyer.html#buc_buyer_segm'],
['Verträge verwalten', '../../buc_buyer.html#buc_buyer_contr']],
['Kundenverwaltung: Begriffe', '../../con_cons.html',
['Kunden-Typen', '../../con_cons.html#con_cons_types'],
['Kunden-Profil ', '../../con_cons.html#con_cons_profile'],
['Kundensegmente', '../../con_cons.html#con_cons_segm'],
['Kundengenehmigung', '../../con_cons.html#con_cons_appr'],
['Verträge', '../../con_cons.html#con_cons_contr'],
['Kennworterinnerung', '../../con_cons.html#con_cons_pw'],
['Anfragen zu persönlichen Daten', '../../con_cons.html#con_cons_dataReq']],
['Kunden-Management', '../../task_cons_mgmt.html',
['Kunden suchen', '../../task_cons_mgmt.html#task_cons_mgmt_search'],
['Kundenkonto anlegen', '../../task_cons_mgmt.html#task_cons_mgmt_create'],
['Kundenprofil bearbeiten', '../../task_cons_mgmt.html#task_cons_mgmt_edit'],
['Neue Kunden annehmen/ablehnen', '../../task_cons_mgmt.html#task_cons_mgmt_appr'],
['Kundenadressen verwalten', '../../task_cons_mgmt.html#task_cons_mgmt_adress'],
['Preislisten verwalten', '../../task_cons_mgmt.html#task_cons_mgmt_price'],
['Kataloganzeigen verwalten', '../../task_cons_mgmt.html#task_cons_mgmt_catView'],
['Bestellungen von Kunden anzeigen', '../../task_cons_mgmt.html#task_cons_mgmt_order'],
['Kundensegment-Zuordnungen anzeigen', '../../task_cons_mgmt.html#task_cons_mgmt_segm'],
['Benutzer von Geschäftskunden verwalten', '../../task_cons_mgmt.html#task_cons_mgmt_bsn'],
['Kundenverwalter für Kunden verwalten', '../../task_cons_mgmt.html#task_cons_mgmt_accountMgr'],
['Kunden löschen', '../../task_cons_mgmt.html#task_cons_mgmt_del'],
['E-Mail zur Kennwort-Wiederherstellung senden', '../../task_cons_mgmt.html#task_cons_mgmt_pw'],
['Anfragen zu persönlichen Daten verwalten', '../../task_cons_mgmt.html#task_cons_mgmt_dataReq']],
['Kundensegmente-Verwaltung', '../../task_cons_grps.html',
['Kundensegmente anlegen', '../../task_cons_grps.html#task_cons_grps_create'],
['Zugeordnete Kunden verwalten', '../../task_cons_grps.html#task_cons_grps_assign'],
['Kundensegment bearbeiten', '../../task_cons_grps.html#task_cons_grps_edit'],
['Preislisten verwalten', '../../task_cons_grps.html#task_cons_grps_price'],
['Kataloganzeigen verwalten', '../../task_cons_grps.html#task_cons_grps_catViews'],
['Kundensegment löschen', '../../task_cons_grps.html#task_cons_grps_del']],
['Verträge verwalten', '../../task_cons_contr.html',
['Alle Verträge anzeigen', '../../task_cons_contr.html#task_cons_contr_viewAll'],
['Verträge suchen', '../../task_cons_contr.html#task_cons_contr_search'],
['Verträge eines Kunden anzeigen', '../../task_cons_contr.html#task_cons_contr_view'],
['Vertrag anlegen', '../../task_cons_contr.html#task_cons_contr_create'],
['Vertragsdetails bearbeiten', '../../task_cons_contr.html#task_cons_contr_edit'],
['Verträge konfigurieren', '../../task_cons_contr.html#task_cons_contr_config'],
['Vertragsumsatz anzeigen', '../../task_cons_contr.html#task_cons_contr_revenue']],
['Kundenimport und -export', '../../task_cons_impex.html',
['Upload von Importdateien', '../../task_cons_impex.html#task_cons_impex_upl'],
['Download von Export-Dateien', '../../task_cons_impex.html#task_cons_impex_dl'],
['Kundenkonten exportieren (XML)', '../../task_cons_impex.html#task_cons_impex_exp'],
['Kundenkonten importieren (XML)', '../../task_cons_impex.html#task_cons_impex_imp']]],
['Betrieb und Wartung', '../../buc_oper_main.html',
['Aktivitäten: Betrieb und Wartung', '../../buc_oper_main.html',
['Organisation', '../../buc_oper_main.html#buc_oper_main_org'],
['Distributionskette', '../../buc_oper_main.html#buc_oper_main_chain'],
['Systemumgebung', '../../buc_oper_main.html#buc_oper_main_sys'],
['Geschäftsaktivitäten', '../../buc_oper_main.html#buc_oper_main_bsn']],
['Organisationsverwaltung: Begriffe', '../../con_org.html',
['Einleitung', '../../con_org.html#con_org_intro'],
['Hauptaufgaben', '../../con_org.html#con_org_wflow'],
['Organisationsprofil', '../../con_org.html#con_org_profile'],
['Abteilungen', '../../con_org.html#con_org_dep'],
['Benutzer', '../../con_org.html#con_org_user'],
['Zugriffsrechte und Rollen', '../../con_org.html#con_org_acc'],
['Verwaltung von Filialen und Filialsuche', '../../con_org.html#con_org_store']],
['Channel-Verwaltung: Begriffe', '../../con_ch.html',
['Hauptaufgaben', '../../con_ch.html#con_ch_wflow'],
['Channel-Typen', '../../con_ch.html#con_ch_types'],
['Organisationsstruktur', '../../con_ch.html#con_ch_struct']],
['Verwaltung von Applikationen: Begriffe', '../../con_apps.html',
['Was ist eine Applikation?', '../../con_apps.html#con_apps_whatis'],
['Hauptaufgaben', '../../con_apps.html#con_apps_tasks'],
['Applikationsdesign', '../../con_apps.html#con_apps_brand'],
['Applikations-Vorschau', '../../con_apps.html#con_apps_preview']],
['Partnerverwaltung: Begriffe', '../../con_partn.html',
['Hauptaufgaben', '../../con_partn.html#con_partn_mainTasks'],
['Partnerprofil', '../../con_partn.html#con_partn_profile'],
['Design für Partner', '../../con_partn.html#con_partn_branding'],
['Zahlungsarten für Partner', '../../con_partn.html#con_partn_pay'],
['Services für Partner', '../../con_partn.html#con_partn_service'],
['Content-Freigaben für Partner', '../../con_partn.html#con_partn_cont']],
['Services', '../../con_serv.html',
['Suchindex-Services', '../../con_serv.html#con_serv_search'],
['Steuerberechnungsservice', '../../con_serv.html#con_serv_tax']],
['Verwaltung von Massendaten: Begriffe', '../../con_mdata.html',
['Hauptaufgaben', '../../con_mdata.html#con_mdata_tasks'],
['Stapelprozesse', '../../con_mdata.html#con_mdata_batchProc'],
['Label-basierte Massendaten-Operationen', '../../con_mdata.html#con_mdata_label'],
['Datenreplizierung', '../../con_mdata.html#con_mdata_rep'],
['Produktsyndizierung', '../../con_mdata.html#con_mdata_sdc'],
['Suchindex-Verwaltung', '../../con_mdata.html#con_mdata_searchInd'],
['Auditbericht-Verwaltung', '../../con_mdata.html#con_mdata_audit'],
['Lokalisierung', '../../con_mdata.html#con_mdata_l10n']],
['Verwaltung des Organisationsprofils', '../../task_org_profile.html',
['Profile anzeigen und bearbeiten', '../../task_org_profile.html#task_org_profile_view'],
['Organisationsadressen verwalten', '../../task_org_profile.html#task_org_profile_mgmt']],
['Abteilungsverwaltung', '../../task_org_dep.html',
['Abteilungen anzeigen', '../../task_org_dep.html#task_org_dep_view'],
['Abteilungen verwalten', '../../task_org_dep.html#task_org_dep_mgmt'],
['Abteilungsbenutzer verwalten', '../../task_org_dep.html#task_org_dep_user'],
['Abteilungsrollen verwalten', '../../task_org_dep.html#task_org_dep_role']],
['Commerce Management-Benutzerverwaltung', '../../task_org_user.html',
['Commerce Management-Benutzer suchen', '../../task_org_user.html#task_org_user_search'],
['Commerce Management-Benutzer anlegen', '../../task_org_user.html#task_org_user_create'],
['Benutzerinformationen des Commerce Management bearbeiten', '../../task_org_user.html#task_org_user_edit'],
['Zugriffsrechte/Rollen zuordnen', '../../task_org_user.html#task_org_user_assign'],
['Commerce Management-Benutzer löschen', '../../task_org_user.html#task_org_user_del'],
['Commerce Management-Benutzer publizieren', '../../task_org_user.html#task_org_user_publ'],
['Deaktivierte Commerce Management-Benutzer entsperren', '../../task_org_user.html#task_org_user_unlock']],
['Commerce Management Benutzer-Import und -Export', '../../task_org_userImpex.html',
['Upload von Importdateien', '../../task_org_userImpex.html#task_org_userImpex_upl'],
['Download von Export-Dateien', '../../task_org_userImpex.html#task_org_userImpex_dl'],
['Commerce Management-Benutzer exportieren (XML)', '../../task_org_userImpex.html#task_org_userImpex_expXml'],
['Commerce Management-Benutzer importieren (XML)', '../../task_org_userImpex.html#task_org_userImpex_impXml'],
['Commerce Management-Benutzer importieren (CSV)', '../../task_org_userImpex.html#task_org_userImpex_impCsv']],
['Verwaltung von globalen Rollen', '../../task_org_role.html',
['Globale Rolle anlegen', '../../task_org_role.html#task_org_role_create'],
['Globale Rolle bearbeiten', '../../task_org_role.html#task_org_role_edit'],
['Globale Rolle entfernen', '../../task_org_role.html#task_org_role_del']],
['Verwaltung von Filialen', '../../task_store_mgmt.html',
['Filialen anzeigen', '../../task_store_mgmt.html#task_store_mgmt_view'],
['Eine Filiale anlegen', '../../task_store_mgmt.html#task_store_mgmt_create'],
['Eine Filiale bearbeiten', '../../task_store_mgmt.html#task_store_mgmt_edit'],
['Eine Filiale löschen', '../../task_store_mgmt.html#task_store_mgmt_del']],
['Filialimport', '../../task_store_impex.html',
['Upload von Importdateien', '../../task_store_impex.html#task_store_impex_upl'],
['Filialen importieren (XML)', '../../task_store_impex.html#task_store_impex_imp']],
['Organisationsstruktur', '../../task_ch_struct.html'],
['Channel-Verwaltung', '../../task_ch_mgmt.html',
['Channel erstellen', '../../task_ch_mgmt.html#task_ch_mgmt_create'],
['Allgemeine Channel-Angaben bearbeiten', '../../task_ch_mgmt.html#task_ch_mgmt_edit'],
['Channel löschen', '../../task_ch_mgmt.html#task_ch_mgmt_del'],
['Channel-Zugriffsrechte verwalten', '../../task_ch_mgmt.html#task_ch_mgmt_privil'],
['Channel-Zahlungsarten verwalten', '../../task_ch_mgmt.html#task_ch_mgmt_pay']],
['Verwaltung von Applikationen', '../../task_app_mgmt.html',
['Neue Applikation anlegen', '../../task_app_mgmt.html#task_app_mgmt_create'],
['Applikation löschen', '../../task_app_mgmt.html#task_app_mgmt_del'],
['Applikationen aktivieren', '../../task_app_mgmt.html#task_app_mgmt_enable'],
['Standard-Applikation festlegen', '../../task_app_mgmt.html#task_app_mgmt_default'],
['Regionale Einstellungen verwalten', '../../task_app_mgmt.html#task_app_mgmt_region'],
['Adressprüfung aktivieren', '../../task_app_mgmt.html#task_app_mgmt_valid'],
['Applikations-Zugriffsrechte verwalten', '../../task_app_mgmt.html#task_app_mgmt_privil'],
['Warenkorb-Einstellungen verwalten', '../../task_app_mgmt.html#task_app_mgmt_cartPref'],
['Zuletzt betrachtete Artikel verwalten', '../../task_app_mgmt.html#task_app_mgmt_items'],
['Aktionseinstellungen verwalten', '../../task_app_mgmt.html#task_app_mgmt_promoPref']],
['Applikation: Designverwaltung', '../../task_app_brand.html',
['Modul Design öffnen', '../../task_app_brand.html#task_app_brand_open'],
['Design-Archivdatei laden', '../../task_app_brand.html#task_app_brand_upl'],
['Designpaket installieren', '../../task_app_brand.html#task_app_brand_install'],
['Designpaket deinstallieren', '../../task_app_brand.html#task_app_brand_uninstall'],
['Designpaket entfernen', '../../task_app_brand.html#task_app_brand_remove']],
['Partnerverwaltung', '../../task_ptn_mgmt.html',
['Nach Partnerkonten suchen', '../../task_ptn_mgmt.html#task_ptn_mgmt_search'],
['Partnerkonto anlegen', '../../task_ptn_mgmt.html#task_ptn_mgmt_create'],
['Partnerprofil bearbeiten', '../../task_ptn_mgmt.html#task_ptn_mgmt_edit'],
['Partner löschen', '../../task_ptn_mgmt.html#task_ptn_mgmt_del'],
['Zahlungsarten für Partner verwalten', '../../task_ptn_mgmt.html#task_ptn_mgmt_pay']],
['Partner: Designverwaltung', '../../task_ptn_brand.html',
['Designpaket laden', '../../task_ptn_brand.html#task_ptn_brand_upl'],
['Designpaket installieren', '../../task_ptn_brand.html#task_ptn_brand_install'],
['Designpaket deinstallieren', '../../task_ptn_brand.html#task_ptn_brand_uninstall'],
['Designpaket entfernen', '../../task_ptn_brand.html#task_ptn_brand_remove']],
['Content-Freigaben für Partner', '../../task_ptn_share.html',
['Freigabebeziehung anlegen', '../../task_ptn_share.html#task_ptn_share_create'],
['Freigabebeziehung aufheben', '../../task_ptn_share.html#task_ptn_share_remove']],
['Verwaltung von Services', '../../task_pref_servMgmt.html',
['Service-Konfigurationen anzeigen', '../../task_pref_servMgmt.html#task_pref_servMgmt_view'],
['Service verfügbar machen', '../../task_pref_servMgmt.html#task_pref_servMgmt_enable'],
['Service Aktivierung/Deaktivierung', '../../task_pref_servMgmt.html#task_pref_servMgmt_activate'],
['Service-Konfigurationen bearbeiten', '../../task_pref_servMgmt.html#task_pref_servMgmt_edit'],
['Service-Einstellungen konfigurieren', '../../task_pref_servMgmt.html#task_pref_servMgmt_config'],
['Service-Konfigurationen anlegen', '../../task_pref_servMgmt.html#task_pref_servMgmt_create'],
['Service-Konfigurationen löschen', '../../task_pref_servMgmt.html#task_pref_servMgmt_del']],
['Google Tag Manager-Service verwenden', '../../task_pref_servGtm.html',
['Voraussetzungen', '../../task_pref_servGtm.html#task_pref_servGtm_precond'],
['Google Tag Manager verfügbar machen', '../../task_pref_servGtm.html#task_pref_servGtm_enable']],
['Steuerberechnungsservices verwalten', '../../task_pref_servTax.html',
['Steuerservices verfügbar machen', '../../task_pref_servTax.html#task_pref_servTax_enable'],
['Steuerservices aktivieren/deaktivieren', '../../task_pref_servTax.html#task_pref_servTax_activate']],
['Suchindex-Services verwalten', '../../task_pref_servSearch.html',
['Suchindex-Service erzeugen', '../../task_pref_servSearch.html#task_pref_servSearch_create'],
['Suchindex-Services konfigurieren', '../../task_pref_servSearch.html#task_pref_servSearch_config']],
['Suchindizes verwalten', '../../task_mdata_searchInd.html',
['Modul Suchindizes öffnen', '../../task_mdata_searchInd.html#task_mdata_searchInd_open'],
['Suchindex hinzufügen', '../../task_mdata_searchInd.html#task_mdata_searchInd_add'],
['Suchindex bearbeiten', '../../task_mdata_searchInd.html#task_mdata_searchInd_edit'],
['Suchindex erzeugen', '../../task_mdata_searchInd.html#task_mdata_searchInd_build'],
['Suchindex aktualisieren', '../../task_mdata_searchInd.html#task_mdata_searchInd_update'],
['Suchindex löschen', '../../task_mdata_searchInd.html#task_mdata_searchInd_del']],
['Allgemeine Einstellungen', '../../task_pref_gen.html',
['Geschenkgutschein-Einstellungen verwalten', '../../task_pref_gen.html#task_pref_gen_gift'],
['Einstellungen zur Genehmigung und Kennworterinnerung verwalten', '../../task_pref_gen.html#task_pref_gen_apprRemind'],
['Vertragseinstellungen verwalten', '../../task_pref_gen.html#task_pref_gen_contr'],
['Einstellungen für die Produktbenachrichtigung verwalten', '../../task_pref_gen.html#task_pref_gen_prodNote'],
['Einstellungen für die Bestellbenachrichtigung verwalten', '../../task_pref_gen.html#task_pref_gen_orderNote'],
['Regionale Einstellungen verwalten', '../../task_pref_gen.html#task_pref_gen_region'],
['Versandeinstellungen verwalten', '../../task_pref_gen.html#task_pref_gen_ship'],
['Wunschlisten-Einstellungen verwalten', '../../task_pref_gen.html#task_pref_gen_wishlist'],
['Zeitraum für Content-Sperre festlegen', '../../task_pref_gen.html#task_pref_gen_contLock'],
['Design-Ansicht-Einstellungen verwalten', '../../task_pref_gen.html#task_pref_gen_designView'],
['SEO-Einstellungen verwalten', '../../task_pref_gen.html#task_pref_gen_seo'],
['E-Mail-Marketing konfigurieren', '../../task_pref_gen.html#task_pref_gen_emm'],
['Produktempfehlungs-Ereignisse verwalten', '../../task_pref_gen.html#task_pref_gen_recomm'],
['Aktionseinstellungen verwalten', '../../task_pref_gen.html#task_pref_gen_promo'],
['Preiseinstellungen verwalten', '../../task_pref_gen.html#task_pref_gen_pricing'],
['Einstellungen zur Vulgarismenprüfung verwalten', '../../task_pref_gen.html#task_pref_gen_profan'],
['Seitencache verwalten', '../../task_pref_gen.html#task_pref_gen_cache'],
['Garantieverwaltung', '../../task_pref_gen.html#task_pref_gen_warranty'],
['CAPTCHA-Verwendung verwalten', '../../task_pref_gen.html#task_pref_gen_captcha']],
['Objekte in Stapelprozessen bearbeiten', '../../task_mdata_batch.html'],
['Verwaltung von Replikationsaufgaben', '../../task_mdata_rep.html',
['Replikationsaufgaben anzeigen', '../../task_mdata_rep.html#task_mdata_rep_view'],
['Replikationsaufgaben anlegen', '../../task_mdata_rep.html#task_mdata_rep_create'],
['Replikationsgruppen zuordnen', '../../task_mdata_rep.html#task_mdata_rep_assign'],
['Replikationsaufgaben übermitteln', '../../task_mdata_rep.html#task_mdata_rep_submit'],
['Replikationsaufgaben verwerfen', '../../task_mdata_rep.html#task_mdata_rep_discard'],
['Kommentare hinzufügen und anzeigen', '../../task_mdata_rep.html#task_mdata_rep_add']],
['Label-Verwaltung', '../../task_mdata_label.html',
['Label anlegen', '../../task_mdata_label.html#task_mdata_label_create'],
['Objekte mit Labeln anzeigen', '../../task_mdata_label.html#task_mdata_label_view'],
['Ein Label mehreren Produkten zuordnen', '../../task_mdata_label.html#task_mdata_label_assignProd'],
['Label einem Katalog / einer Kategorie zuweisen', '../../task_mdata_label.html#task_mdata_label_assignCat'],
['Label-Katalog/Kategorie-Zuordnung aufheben', '../../task_mdata_label.html#task_mdata_label_unassignCat'],
['Aktionen für Objekte mit Labeln durchführen', '../../task_mdata_label.html#task_mdata_label_action']],
['Produktsyndizierung und Synchronisierung', '../../task_pim_sdc.html',
['Nach Produkten suchen', '../../task_pim_sdc.html#task_pim_sdc_search'],
['Nach Produkten durchsuchen', '../../task_pim_sdc.html#task_pim_sdc_browse'],
['Produktänderungen anzeigen', '../../task_pim_sdc.html#task_pim_sdc_viewDetails'],
['Geänderte Produkte anzeigen', '../../task_pim_sdc.html#task_pim_sdc_viewProd'],
['Produktänderungen manuell synchronisieren', '../../task_pim_sdc.html#task_pim_sdc_syncMnl'],
['Produktänderungen automatisch synchronisieren', '../../task_pim_sdc.html#task_pim_sdc_syncAuto'],
['Alle Produkte manuell synchronisieren', '../../task_pim_sdc.html#task_pim_sdc_syncAllAuto'],
['Attributzuordnungsregeln bearbeiten', '../../task_pim_sdc.html#task_pim_sdc_edit']],
['Auditbericht-Verwaltung', '../../task_mdata_audit.html',
['Auditbericht konfigurieren', '../../task_mdata_audit.html#task_mdata_audit_config'],
['Auditbericht erzeugen', '../../task_mdata_audit.html#task_mdata_audit_generate'],
['Audit-Ergebnisse anzeigen', '../../task_mdata_audit.html#task_mdata_audit_view']],
['Prozess-Ketten', '../../task_mdata_jobs.html',
['Voraussetzungen für das Verwalten von Prozessketten', '../../task_mdata_jobs.html#task_mdata_jobs_precon'],
['Liste der Prozessketten', '../../task_mdata_jobs.html#task_mdata_jobs_proc'],
['Prozesskette anlegen', '../../task_mdata_jobs.html#task_mdata_jobs_create'],
['Prozesskette löschen', '../../task_mdata_jobs.html#task_mdata_jobs_del'],
['Schritte einer Prozesskette konfigurieren', '../../task_mdata_jobs.html#task_mdata_jobs_config'],
['Prozessketten-Zeitplan festlegen', '../../task_mdata_jobs.html#task_mdata_jobs_schedule'],
['Prozesskette manuell ausführen', '../../task_mdata_jobs.html#task_mdata_jobs_mnl'],
['Prozessketten-Statistik ansehen', '../../task_mdata_jobs.html#task_mdata_jobs_stats']],
['Lokalisierungsverwaltung', '../../task_pref_l10n.html',
['Lokalisierte Texte verwalten', '../../task_pref_l10n.html#task_pref_l10n_mgmt'],
['Import und Export von Lokalisierungswerten', '../../task_pref_l10n.html#task_pref_l10n_impex']]]]];
|
window.onload = function() {
var gifArray = ["jello", "trip", "puppy", "fire", "twerk"];
function renderGifBtns(){
$("#buttonBox").empty()
for(var i=0; i<gifArray.length; i++){
var newGifBtn = $("<button>");
$(newGifBtn).attr("id", gifArray[i]).addClass("gifButton btn btn-primary btn-lg").html(gifArray[i]);
$("#buttonBox").append(newGifBtn)
}
}
function renderGifs(KeyWord){
var queryURL = "//api.giphy.com/v1/gifs/search?api_key=dc6zaTOxFJmzC&q="+KeyWord+"&limit=10";//added https to resove deployment issue
$.ajax({
url: queryURL,
method: "GET"
})
.done(function(response) {
$("#imageBox").empty();
for(var i=0; i<response.data.length;i++){
var gifImage = $("<img>");
var gifRating = $("<h2>");
gifImage.attr("id", response.data[i].id);
gifImage.attr("src", response.data[i].images.fixed_height_still.url);
gifImage.attr("alt", "image missing__");
gifImage.attr("data-still", response.data[i].images.fixed_height_still.url);
gifImage.attr("data-animate", response.data[i].images.fixed_height.url);
gifImage.attr("data-state", "still");
gifImage.addClass("imgBtn");
$("#imageBox").append(gifImage);
gifRating.html(response.data[i].rating)
$("#imageBox").append(gifRating);
}
})
}
function searchGIF(newGif){
gifArray.push(newGif);
renderGifBtns();
renderGifs(newGif);
}
function animateGif(id){
var currentState = $("#"+id).attr("data-state");
if (currentState === "still") {
$("#"+id).attr("src", $("#"+id).attr("data-animate"));
$("#"+id).attr("data-state", "animate");
} else {
$("#"+id).attr("src", $("#"+id).attr("data-still"));
$("#"+id).attr("data-state", "still");
}
}
$("#buttonBox").on("click",".gifButton",function(){
renderGifs(this.id);
})
$("#imageBox").on("click",".imgBtn",function(){
animateGif(this.id);
})
$("#searchBTN").on("click", function(){
searchGIF($("#searchInput").val());
})
renderGifBtns();
}
|
var searchData=
[
['ti_5fsdo_5fce_5fosal_5fmemory_5fallocparams',['ti_sdo_ce_osal_Memory_AllocParams',['../structti__sdo__ce__osal___memory___alloc_params.html',1,'']]]
];
|
import bs from 'browser-sync'
import { styles } from './styles.js'
import { scripts } from './scripts.js'
import { assets } from './assets.js'
import pkg from 'gulp'
import { prepareHtmlDev } from './prepare-html-dev.js'
import { convertHBS } from './hbs.js'
const { series, watch } = pkg
export const server = bs.create()
export const initServer = () => {
return server.init({
server: [$.conf.outputPath],
startPath: $.conf.htmlPages,
ui: false,
notify: false,
logSnippet: false,
port: 3000,
//browser: 'google chrome',
})
}
export const initWatcher = () => {
const watchHBS = [`${$.conf.app}/${$.conf.pathHTML}/**/*`, `${$.conf.app}/${$.conf.pathDB}/**/*`]
// watch(`${$.conf.app}/${$.conf.pathHTML}/**/*.html`, series(optHTML))
watch(`${$.conf.app}/${$.conf.pathStyles}/**/*.scss`, series(styles))
watch(`${$.conf.app}/${$.conf.pathJS}/**/*`, series(scripts))
watch(`${$.conf.src}/${$.conf.pathAssets}/**/*`, series(assets))
watch(watchHBS, series(convertHBS, prepareHtmlDev))
}
|
import axios from 'axios'
import {BASE_URL} from './config'
export function getArtistList () {
return new Promise((resolve, reject) => {
axios.get(`${BASE_URL}/top/artists?offset=0&limit=100`)
.then(res => {
resolve(res.data)
})
.catch(err => reject(err))
})
}
export function getArtistDetail (artistId) {
return new Promise((resolve, reject) => {
axios.get(`${BASE_URL}/artists?id=${artistId}`)
.then(res => {
resolve(res.data)
})
.catch(err => reject(err))
})
}
|
import React, { useState, useEffect } from 'react';
import { BrowserRouter as Router, Route } from "react-router-dom";
import axios from 'axios';
import List from "./components/List";
import View from "./components/View";
import AddEdit from "./components/Add-Edit";
import 'bootstrap/dist/css/bootstrap.min.css';
import './App.css';
const apiUrl = 'http://localhost:4000/api/person'
function App() {
const [persons, setPersons] = useState([])
useEffect(() => {
axios.get(apiUrl)
.then(res => {
const persons = res.data;
setPersons(persons);
})
},[])
const deletePerson = (id) => {
axios.delete(`${apiUrl}/${id}`)
.then(res => {
const newPersonList = persons.filter(person => {
return person._id !== id
})
setPersons(newPersonList);
}).catch(err => alert('Unable to Delete'))
}
const addPerson = (e) => {
e.preventDefault()
const firstName = e.target.elements.firstName.value,
lastName = e.target.elements.lastName.value,
age = e.target.elements.age.value,
email = e.target.elements.email.value
axios.post(apiUrl, {
firstName,
lastName,
age,
email
}).then(res => {
const newPerson = res.data
setPersons([...persons, newPerson])
alert('New person added')
e.target.elements.firstName.value = ''
e.target.elements.lastName.value = ''
e.target.elements.age.value = ''
e.target.elements.email.value = ''
})
.catch(err => alert('Unable to Add Person. Make sure you are using unique email'))
}
const updatePerson = (e, personId) => {
e.preventDefault()
const firstName = e.target.elements.firstName.value,
lastName = e.target.elements.lastName.value,
age = e.target.elements.age.value,
email = e.target.elements.email.value
axios.put(`${apiUrl}/${personId}`, {
firstName,
lastName,
age,
email
}).then(res => {
const personsClone = [...persons]
const updatedPerson = personsClone.map(person => {
if(person._id === personId) {
person.firstName = firstName
person.lastName = lastName
person.age = age
person.email = email
}
return {...person}
})
setPersons(updatedPerson)
alert('Updated')
})
.catch(err => alert('Unable to Update'))
}
return (
<>
<Router>
<div className="container">
<Route exact path='/' render={() => (
<List users={persons} deleteUser={deletePerson} />
)} />
<Route path='/view' render={() => (
<View />
)} />
<Route path='/add-edit' render={() => (
<AddEdit updateUser={updatePerson} addUser={addPerson} />
)} />
</div>
</Router>
</>
);
}
export default App;
|
'use strict';
angular
.module('tagstered')
.factory(
'InstagramAuthService',
[
'$http',
'$sce',
'$window',
function($http, $sce, $window) {
var apiURL = '/tagstered/auth/';
return {
getClientId : getClientId,
getUserByAccessToken : getUserByAccessToken,
login : login
};
function getClientId(success, error) {
$http({
method : 'GET',
url : apiURL + '/clientId',
headers : {
'Content-Type' : 'application/json'
}
}).then(success, error);
}
function getUserByAccessToken(token, callback,
error) {
var urlTo = 'https://api.instagram.com/v1/users/self/?access_token='
+ token + '&callback=JSON_CALLBACK';
$sce.trustAsResourceUrl(urlTo);
$http.jsonp(urlTo, {
method : 'GET'
}).then(function(response) {
callback(response.data);
}, error);
}
function login(success, error) {
$http({
method : 'GET',
url : apiURL + '/loginUrl',
headers : {
'Content-Type' : 'application/json'
}
}).then(function(response) {
$window.location.href = response.data.value;
}, error)
}
} ]);
|
const browser = require('../../../../codeceptCommon/browser')
const BrowserWaits = require('../../../support/customWaits')
class AddUserPage{
constructor(){
this.container = $('exui-staff-add-edit-user-form')
this.headerTitle = $('exui-staff-add-edit-user-form .govuk-heading-xl')
this.firstName = $('input#first_name')
this.lastName = $('input#last_name')
this.email = $('input#email_id')
this.region = $('#region_id')
this.services = $('#services')
this.primaryLocation = $('#base_locations_primary exui-staff-select-location #location-primary')
this.primaryLocationAddBtn = $('#base_locations_primary exui-staff-select-location a')
this.additionalLocations = $('#base_locations_additional exui-staff-select-location #location-primary')
this.additionalLocationAddBtn = $('#base_locations_additional exui-staff-select-location a')
this.userType = $('#user_type')
this.roles = $('#roles')
this.jobTitles = $('#checkbox_job_title')
this.continue = element(by.xpath('//button[contains(text(),"Continue")]'))
this.saveChanges = element(by.xpath('//button[contains(text(),"Save changes")]'))
this.cancel = element(by.xpath('//button[contains(text(),"Cancel")]'))
}
async getPageTitle(){
return this.headerTitle.getText();
}
async isDisplayed(){
return await this.container.isDisplayed();
}
async clickContinue(){
await this.continue.click();
}
async clickSaveChanges() {
await this.continue.click();
}
async clickCancel() {
await this.cancel.click();
}
async enterDetails(userDetails){
const keys = Object.keys(userDetails);
for(const key of keys){
const inputVal = userDetails[key]
switch(key){
case "First name":
await this.firstName.sendKeys(inputVal)
break;
case "Last name":
await this.lastName.sendKeys(inputVal)
break;
case "Email":
await this.email.sendKeys(inputVal)
break;
case "Region":
await this.region.selectOptionAtIndex(1)
break;
case "Services":
const checkBoxElements = await checkBoxes(this.services)
const labels = Object.keys(checkBoxElements)
for(const service of inputVal) {
if (!labels.includes(service)){
throw new Error(`input ${service} not in the services list`)
}else{
await checkBoxElements[service].click()
}
}
break;
case "Primary location":
await this.primaryLocation.scrollIntoView()
await this.primaryLocation.sendKeys(inputVal)
const searchResults = $$('.mat-option-text');
let e = null;
await BrowserWaits.retryWithActionCallback(async () => {
await browser.sleep(2)
e = await searchResults.getItemWithText(inputVal);
if(e === null){
throw new Error('locations not found, retry waiting')
}
})
await e.click();
await this.primaryLocationAddBtn.click();
break;
case "Additional locations":
inputVal.forEach(async(loc) => {
await this.additionalLocations.sendKeys(loc)
const additionaLocationResults = $$('.mat-option-text');
let ale = null;
await BrowserWaits.retryWithActionCallback(async () => {
await browser.sleep(2)
ale = additionaLocationResults.getItemWithText(loc);
if (ale === null) {
throw new Error('locations not found, retry waiting')
}
})
await ale.click();
await this.additionalLocationAddBtn.click();
})
break;
case "User type":
await this.userType.selectOptionWithLabel(inputVal)
break;
case "roles":
const rolesCheckBoxElements = await checkBoxes(this.roles)
const roleLabels = Object.keys(rolesCheckBoxElements)
for(const role of inputVal) {
if (!roleLabels.includes(role)) {
throw new Error(`input ${role} not in the roles list`)
} else {
await rolesCheckBoxElements[role].click()
}
};
break;
case "Job title":
const jobTitleCheckBoxElements = await checkBoxes(this.jobTitles)
const jobTitleLabels = Object.keys(jobTitleCheckBoxElements)
for (const title of inputVal) {
if (!jobTitleLabels.includes(title)) {
throw new Error(`input ${title} not in the roles list`)
} else {
await jobTitleCheckBoxElements[title].click()
}
}
break;
}
}
}
}
async function checkBoxes(parent){
const checkBoxes = {};
const elements = parent.$$('.govuk-checkboxes__item')
const count = await elements.count()
for(let i = 0; i< count; i++){
const e = elements.get(i);
const label = await e.$('label').getText();
checkBoxes[label] = e.$('input')
}
return checkBoxes;
}
module.exports = new AddUserPage();
|
import ExpFrameBaseComponent from '../exp-frame-base/component';
import VideoRecord from '../../mixins/video-record';
import layout from './template';
import Em from 'ember';
import { observer } from '@ember/object';
let {
$
} = Em;
/**
* @module exp-player
* @submodule frames
*/
/**
* A frame to collect a video observation with the participant's help. By default the
* webcam is displayed to the participant and they can choose when to start, pause, and
* resume recording. The duration of an individual recording can optionally be limited
* and/or recording can be started automatically. This is intended for cases where we
* want the parent to perform some test or behavior with the child, rather than
* presenting stimuli ourselves. E.g., you might give instructions to conduct a structured
* interview and allow the parent to control recording.
*
* Each element of the 'blocks' parameter is rendered using {{#crossLink "Exp-text-block"}}{{/crossLink}}.
*
```
"frames": {
"observation": {
"kind": "exp-lookit-observation",
"blocks": [
{
"title": "Time to do the joke!",
"listblocks": [
{
"text": "Rip the paper"
},
{
"text": "Wait ten seconds"
}
]
}
],
"hideWebcam": true,
"hideControls": false,
"recordSegmentLength": 10,
"startRecordingAutomatically": false,
"nextButtonText": "move on",
"showPreviousButton": false
}
}
```
* @class Exp-lookit-observation
* @extends Exp-frame-base
* @extends Video-record
*/
export default ExpFrameBaseComponent.extend(VideoRecord, {
type: 'exp-lookit-observation',
layout: layout,
recordingTimer: null,
progressTimer: null,
okayToProceedTimer: null,
timerStart: null,
hasStartedRecording: false,
recordingStarted: false,
toggling: false,
hidden: false,
recorderElement: '#recorder',
frameSchemaProperties: {
/**
* Array of blocks for {{#crossLink "Exp-text-block"}}{{/crossLink}}, specifying text/images of instructions to display
*
* @property {Object[]} blocks
* @param {String} title Title of this section
* @param {String} text Paragraph text of this section
* @param {Object[]} listblocks Object specifying bulleted points for this section. Each object is of the form:
* {text: 'text of bullet point', image: {src: 'url', alt: 'alt-text'}}. Images are optional.
*/
blocks: {
type: 'array',
items: {
type: 'object',
properties: {
title: {
type: 'string'
},
text: {
type: 'string'
},
listblocks: {
type: 'array',
items: {
type: 'object',
properties: {
text: {
type: 'string'
},
image: {
type: 'object',
properties: {
src: {
type: 'string'
},
alt: {
type: 'string'
}
}
}
}
}
}
}
},
default: []
},
/**
* Number of seconds to record for before automatically pausing. Use
* 0 for no limit.
*
* @property {String} recordSegmentLength
* @default 300
*/
recordSegmentLength: {
type: 'number',
default: 300
},
/**
* Whether to automatically begin recording upon frame load
*
* @property {Boolean} startRecordingAutomatically
* @default false
*/
startRecordingAutomatically: {
type: 'boolean',
default: false
},
/**
* Whether a recording must be made to proceed to next frame. 'Next' button
* will be disabled until recording is made if so. 0 to not require recording;
* any positive number to require that many seconds of recording
*
* @property {Boolean} recordingRequired
* @default false
*/
recordingRequired: {
type: 'number',
default: 0
},
/**
* Whether to hide video recording controls (only use with startRecordingAutomatically)
*
* @property {Boolean} hideControls
* @default false
*/
hideControls: {
type: 'boolean',
default: false
},
/**
* Whether to hide webcam view when frame loads (participant will still be able to show manually)
*
* @property {Boolean} hideWebcam
* @default false
*/
hideWebcam: {
type: 'boolean',
default: false
},
/**
* Text to display on the 'next frame' button
*
* @property {String} nextButtonText
* @default 'Next'
*/
nextButtonText: {
type: 'string',
default: 'Next'
},
/**
* Whether to show a 'previous' button
*
* @property {Boolean} showPreviousButton
* @default true
*/
showPreviousButton: {
type: 'boolean',
default: true
}
},
meta: {
data: {
type: 'object',
properties: {
videoId: {
type: 'string'
},
videoList: {
type: 'list'
}
},
required: ['videoId']
}
},
// Override to deal with whether or not recording is starting automatically
whenPossibleToRecord: observer('recorder.hasCamAccess', 'recorderReady', function() {
if (this.get('recorder.hasCamAccess') && this.get('recorderReady')) {
if (this.get('startRecordingAutomatically')) {
this.send('record');
} else {
$('#recordButton').show();
$('#recordingText').text(this._translate('exp-lookit-observation.not-recording-yet'));
}
if (this.get('hideWebcam')) {
$('#webcamToggleButton').html(this._translate('exp-lookit-observation.Show'));
$('#hiddenWebcamMessage').show();
$(this.get('recorderElement') + ' div').addClass('exp-lookit-observation-hidevideo');
this.set('hidden', true);
/**
* Webcam display hidden from participant
*
* @event webcamHidden
*/
this.send('setTimeEvent', 'webcamHidden');
}
}
}),
didInsertElement() { // initial state of all buttons/text
$('#hiddenWebcamMessage').hide();
$('#recordButton').hide();
$('#pauseButton').hide();
$('#recordingIndicator').hide();
$('#recordingText').text('');
$('#recordButtonText').text(this._translate('exp-lookit-observation.Record'));
if (this.get('recordingRequired')) {
$('#nextbutton').prop('disabled', true);
$('#nextbutton').text(this._translate('exp-lookit-observation.recording-required-warning'));
}
this._super(...arguments);
},
enableNext() {
$('#nextbutton').prop('disabled', false);
$('#nextbutton').text(this.get('nextButtonText'));
},
actions: {
record() {
this.startRecorder(); // TODO: use then
var _this = this;
if (this.get('recordSegmentLength')) { // no timer if 0
window.clearTimeout(this.get('recordingTimer')); // as a precaution in case still running
window.clearInterval(this.get('progressTimer'));
window.clearTimeout(this.get('okayToProceedTimer'));
this.set('timerStart', new Date().getTime());
this.set('recordingTimer', window.setTimeout(function() {
/**
* Video recording automatically paused upon reaching time limit
*
* @event recorderTimeout
*/
_this.send('setTimeEvent', 'recorderTimeout');
_this.send('pause');
}, _this.get('recordSegmentLength') * 1000));
this.set('progressTimer', window.setInterval(function() {
var prctDone = (_this.get('recordSegmentLength') * 1000 - (new Date().getTime() - _this.get('timerStart'))) / (_this.get('recordSegmentLength') * 10);
$('.progress-bar').css('width', prctDone + '%');
}, 100));
if (this.get('recordingRequired')) {
this.set('okayToProceedTimer', window.setTimeout(function() {
_this.enableNext();
}, 1000 * this.get('recordingRequired')));
}
}
$('#pauseButton').show();
$('#recordButton').hide();
$('#recordingIndicator').show();
$('#recordingText').text(`${this._translate('exp-lookit-observation.Recording')}...`);
$('#recordButtonText').text(this._translate('exp-lookit-observation.Record'));
},
proceed() { // make sure 'next' fires while still on this frame
window.clearTimeout(this.get('recordingTimer')); // no need for current timer
window.clearTimeout(this.get('okayToProceedTimer'));
window.clearInterval(this.get('progressTimer'));
this.stopRecorder().finally(() => {
this.destroyRecorder();
this.send('next');
});
},
pause() {
var _this = this;
$('#recordingText').text(`${this._translate('exp-lookit-observation.stopping-and-uploading')}...`);
$('#pauseButton').hide();
window.clearTimeout(_this.get('recordingTimer')); // no need for current timer
window.clearTimeout(this.get('okayToProceedTimer'));
window.clearInterval(_this.get('progressTimer'));
$('.progress-bar').css('width', '100%');
$('#recordingIndicator').hide();
this.stopRecorder().finally(() => {
$('#recordButton').show();
$('#recordingText').text(_this._translate('exp-lookit-observation.Paused'));
_this.destroyRecorder();
_this.setupRecorder(_this.$(_this.get('recorderElement')));
});
},
toggleWebcamButton() {
if (!this.toggling) {
this.set('toggling', true);
if (!this.get('hidden')) {
$('#webcamToggleButton').html(this._translate('exp-lookit-observation.Show'));
$('#hiddenWebcamMessage').show();
$(this.get('recorderElement') + ' div').addClass('exp-lookit-observation-hidevideo');
this.set('hidden', true);
/**
* Webcam display hidden from participant
*
* @event hideWebcam
*/
this.send('setTimeEvent', 'hideWebcam');
} else {
$('#webcamToggleButton').html(this._translate('exp-lookit-observation.Hide'));
$('#hiddenWebcamMessage').hide();
$(this.get('recorderElement') + ' div').removeClass('exp-lookit-observation-hidevideo');
this.set('hidden', false);
this.send('setTimeEvent', 'showWebcam');
}
this.set('toggling', false);
}
}
}
});
|
var EnumerationInstance = function(enumeration, value){
this.enumeration = enumeration;
this.value = value;
};
EnumerationInstance.prototype.constructor = EnumerationInstance;
module.exports = EnumerationInstance;
|
const express = require('express');
const speakersRoute = require('./speakers');
const feedbackRoute = require('./feedback');
const router = express.Router();
module.exports = ({ feedbackService, speakerService }) => {
router.get('/', (req, res) => {
res.render('pages/index', { pageTitle: 'Welcome' });
});
router.use('/speakers', speakersRoute(speakerService));
router.use('/feedback', feedbackRoute(feedbackService));
return router;
};
|
// Responde las siguientes preguntas en los comentarios:
// ¿Cuál tipo de promedio elegiste para trabajar?
//--> Rango Medio
// ¿Qué casos de uso tiene tu tipo de promedio?
// --> Es una medidas útil que nos ayuda a analizar un conjunto de datos.
// Al ver los datos necesitamos entender cómo se extienden.
// ¿Cómo traduces su fórmula a código JavaScript?
//Definicion de formulas
// let lista = [
// 10, 20, 15, 11, 31, 12
// ]
// let valorMax = Math.max.apply(null, lista)
// console.log(valorMax)
// let valorMin = Math.min.apply(null, lista)
// console.log(valorMin)
// let sumaValores = valorMax + valorMin;
// let rangoMedio = sumaValores / 2;
// console.log(rangoMedio)
//Encapsulo las formulas en una function
function calcularRangoMedio(lista) {
let valorMax = Math.max.apply(null, lista)
let valorMin = Math.min.apply(null, lista)
let sumaValores = valorMax + valorMin;
let rangoMedio = sumaValores / 2;
return rangoMedio;
}
|
import java.util.*;
import java.io.*;
class Node {
Node left;
Node right;
int data;
Node(int data) {
this.data = data;
left = null;
right = null;
}
}
class Solution {
/*
class Node
int data;
Node left;
Node right;
*/
public static int height(Node root){
int leftHeight = 0;
int rightHeight = 0;
if (root != null){
if (root.left != null){
leftHeight = height(root.left)+1;
}
if (root.right != null){
rightHeight = height(root.right)+1;
}
}
return leftHeight > rightHeight ? leftHeight : rightHeight;
}
public static Node insert(Node root, int data) {
|
$(function() {
console.log("ready!");
$("#agreeToTermsCheckbox").click(checkIfToEnableOpenIssueButton);
$("#submitQuestionModalBtn").click(function() {
$("#submitQuestionFormBtn").click();
});
});
function checkIfToEnableOpenIssueButton() {
if ($("#agreeToTermsCheckbox").prop("checked")) {
$("#openIssueBtn").prop('disabled', false);
}
else {
$("#openIssueBtn").prop('disabled', true);
}
}
|
// pages/my/my.js
import My from './my-model.js'
const my =new My()
Page({
//页面的初始数据
data: {
isLogin:false
},
//生命周期函数--监听页面加载
onLoad: function (options) {
let token = wx.getStorageSync('token')
this.setData({isLogin:token})
console.log('token',token)
},
goMap(e) {
wx.navigateTo({
url: '/pages/map/map',
})
},
login(){
wx.login({
success:(res)=>{
console.log(res)
my.axios("POST",'/api/user/appletlogin',{code:res.code})
.then((res)=>{
console.log(res)
let token=res.token
wx.setStorageSync('token',token)
this.setData({isLogin:true})
})
}
})
},
getInfo(){
wx.getUserInfo({
success(info){
console.log(info)
},
fail(){
console.log(err)
}
})
}
})
|
const getters = {
// getObj: state => {
// return state.obj
// }
}
export default getters
|
import React, { useEffect } from 'react'
import { useDispatch, useSelector } from 'react-redux'
import { clearToCart, removeFromCart } from '../../actions/cart'
import Checkout from '../../components/Checkout'
import Message from '../../components/Message'
import { orderCreate } from '../../actions/order'
import Loader from '../../components/Loader'
const PlaceOrder = ({ history }) => {
const cart = useSelector(state => state.cart)
const { cartItems, shippingAddress, paymentMethod } = cart
const userLogin = useSelector(state => state.userLogin)
const { userInfo } = userLogin
const createOrder = useSelector(state => state.createOrder)
const { loading, error, success, order } = createOrder
cart.itemsPrice = cartItems.reduce((acc, item) => acc + (item.price * item.qty), 0).toFixed(2)
cart.shippingPrice = (cart.itemsPrice > 500 ? 0 : 100).toFixed(2)
cart.taxPrice = (cart.itemsPrice * .30).toFixed(2)
cart.totalPrice = (Number(cart.itemsPrice) + Number(cart.shippingPrice) + Number(cart.taxPrice)).toFixed(2)
const dispatch = useDispatch()
useEffect(() => {
if (success) {
history.push(`/order/${order._id}`)
dispatch(clearToCart())
}
}, [success, history, order, dispatch])
const submitHandler = () => {
dispatch(orderCreate({
orderItems: cartItems,
shippingAddress,
paymentMethod,
itemsPrice: cart.itemsPrice,
shippingPrice: cart.shippingPrice,
taxPrice: cart.taxPrice,
totalPrice: cart.totalPrice,
}))
}
return (
<section className="py-5">
<Checkout step1 step2 step3 step4 />
<div className="container">
<h2>Shipping</h2>
<div className="row">
<div className="col-md-8">
<p>Address: <strong className="mx-1">
{shippingAddress.address},{shippingAddress.city},{shippingAddress.postalCode},{shippingAddress.country}
</strong></p>
<p>Name: <strong> {userInfo.user.name} </strong></p>
<p>Email: <strong> {userInfo.user.email} </strong></p>
<h2 className="mt-4">Payment Method</h2>
<p>Method: <strong className="text-success"> {paymentMethod} </strong></p>
<h2 className="mt-4">Order Items</h2>
<div className="list-group">
{cartItems.length === 0 ? (<Message variant="danger">Your Cart is Empty</Message>) : (
cartItems.map(item => (
<div className="list-group-item" key={item.product}>
<div className="row">
<div className="col-2">
<img src={item.image} className="img-fluid w-100" />
</div>
<div className="col-4">
{item.name}
</div>
<div className="col-4">
${item.price} x {item.qty} = ${item.price * item.qty}
</div>
<div className="col-2">
<button className="btn" onClick={() => dispatch(removeFromCart(item.product))}><i className="fas fa-trash text-danger"></i></button>
</div>
</div>
</div>
))
)}
</div>
</div>
<div className="col-md-4">
<div className="card card-body text-center">
<h2>Order Summary</h2>
<hr />
<div className="row">
<div className="col-6">
<h6>Items Price</h6>
</div>
<h6 className="col-6"> ${cart.itemsPrice} </h6>
<p className="ml-3">(Item Price <strong>above $500</strong> No Shipping Price)</p>
</div>
<hr />
<div className="row">
<h6 className="col">Shipping Price</h6>
<h6 className="col"> ${cart.shippingPrice} </h6>
</div>
<hr />
<div className="row">
<h6 className="col">Tax Price</h6>
<h6 className="col"> ${cart.taxPrice} </h6>
</div>
<hr />
<div className="row text-success">
<h6 className="col">Total Price</h6>
<h6 className="col"> ${cart.totalPrice} </h6>
</div>
<hr />
<button onClick={submitHandler} disabled={!paymentMethod || cartItems.length === 0} className="btn btn-dark btn-block mb-2">Place Order</button>
{!paymentMethod && <p className="text-danger">Make Sure You have Choosed The Payment Method</p>}
{ error && <Message variant="danger"> {error} </Message> }
{ loading && <Loader /> }
</div>
</div>
</div>
</div>
</section>
)
}
export default PlaceOrder
|
import React from 'react';
import Row from "./Row";
const ProducTable = ({category1,category2}) => (
<table className="striped z-depth-2">
<thead>
<tr>
<th>Name</th>
<th>Item Price</th>
</tr>
</thead>
<tbody>
<tr>
<td> <h5>{ category1[0].category}</h5>
</td>
</tr>
{
category1.map((el,i) =>
<Row
name={el.name}
price={el.price}
avaible={el.stocked}
key={i}
/>
)
}
<tr>
<td> <h5>{ category2[0].category}</h5>
</td>
</tr>
{
category2.map((el,i) =>
<Row
name={el.name}
price={el.price}
avaible={el.stocked}
key={i}
/>
)
}
</tbody>
</table>
);
export default ProducTable;
|
import React from 'react'
import axios from 'axios';
import PostPreview from '../../components/PostPreview'
class Home extends React.Component {
constructor(props){
super(props);
this.state = {
posts: []
}
}
async componentDidMount() {
await axios.get('http://localhost:4000/posts')
.then((res) => {
this.setState({ posts: res.data })
})
}
render() {
let posts = this.state.posts.map((post, i) => {
return <PostPreview
key={i}
parentMethod={this.props.parentMethod}
postId={post.id}
date={post.created_at}
title={post.title}
/>
})
return (
<div className="mb-5 pb-5">
{posts}
</div>
);
}
}
export default Home;
|
import produce from 'immer';
import { FETCH_COUNTRIES, FETCH_COUNTRIES_SUCCESS, FETCH_COUNTRIES_FAIL, CHANGE_SEARCH, CHANGE_REGION } from "./actionTypes";
export const INITIAL_STATE = {
loading: false,
error: false,
countries: false,
search: '',
region: ''
};
function rootReducer(state = INITIAL_STATE, action) {
return produce(state, draft => {
switch (action.type) {
case FETCH_COUNTRIES:
draft.loading = true;
draft.error = false;
draft.countries = false;
break;
case FETCH_COUNTRIES_SUCCESS:
draft.loading = false;
draft.countries = action.countries;
break;
case FETCH_COUNTRIES_FAIL:
draft.loading = false;
draft.error = action.error;
break;
case CHANGE_SEARCH:
draft.search = action.search;
break;
case CHANGE_REGION:
draft.region = action.region;
break;
default:
return draft;
}
});
}
export default rootReducer;
|
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { graphql, compose } from 'react-apollo';
import { Link } from 'react-router-dom';
import { LineContainer, VContainer, FlexContainer } from '@xinghunm/widgets';
import {
serverAddressQuery, channelsListQuery, addChannelMutation, deleteChannelMutation
} from '../../models/gql/remote';
import ChannelDetails from './ChannelDetails';
import SelectedChannel from './SelectedChannel';
const Ul = styled.ul`
list-style: none;
padding: 0;
`;
const Li = styled.li`
padding: 10px 20px;
position: relative;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
font-weight: 400;
width: 20%;
text-align: left;
a {
color: rgba(255, 255, 255, 0.8);
}
`;
const ChannelsContainer = styled.div`
padding: 0 30px;
position: relative;
input {
width: 200px;
background-color: transparent;
padding: 10px 20px 10px 30px;
outline: none;
border: none;
color: #fff;
font-size: 16px;
font-weight: 300;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
transition: 300ms all ease-out;
&:focus {
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
transition: 300ms all ease-out;
}
}
&:before {
content: "+";
display: inline-block;
height: 10px;
width: 10px;
/*background-color: #fff;*/
position: absolute;
top: 7.5px;
left: 40px;
color: rgba(255, 255, 255, 0.6);
}
`;
const Button = styled.div`
outline: none;
margin: 5px;
position: absolute;
left: 22%;
width: 30px;
height: 30px;
color: red;
cursor: pointer;
opacity: 0.5;
&:hover {
opacity: 1;
}
`;
// const DetailButton = styled.button`
// outline: none;
// margin: 5px;
// position: absolute;
// right: 0;
// width: 60px;
// height: 30px;
// `;
const AddChannel = ({ addChannel1, addChannel2 }) => {
const handleKeyUp = (evt) => {
if (evt.keyCode === 13) {
evt.persist();
addChannel1(evt.target.value).then(() => {
evt.target.value = '';
});
}
};
return (
<input
type="text"
placeholder="New channel"
onKeyUp={handleKeyUp}
/>
);
};
AddChannel.propTypes = {
addChannel1: PropTypes.func.isRequired,
addChannel2: PropTypes.func.isRequired
};
// 多个mutation
const AddChannelWithMutations = compose(
graphql(addChannelMutation, {
props: ({ mutate }) => ({
addChannel1: name => mutate({
variables: {
name,
},
optimisticResponse: { // update前更新
addChannel: {
name,
id: Math.round(Math.random() * -1000000),
__typename: 'Channel'
}
},
update: (cache, { data: { addChannel }, loading, error }) => { // addChannel为该mutation返回的数据
// Read the data from the cache for this query.
const { channels } = cache.readQuery({ query: channelsListQuery });
// Write the data back to the cache.
cache.writeQuery({
query: channelsListQuery,
data: { channels: channels.concat([addChannel]) } // 不能修改源数据,否则无法更新
});
},
// refetchQueries: [{ query: channelsListQuery }], // mutation完成后重新获取以刷新ui
})
}),
}),
graphql(addChannelMutation, {
props: ({ mutate }) => ({
addChannel2: () => mutate()
}),
}),
)(AddChannel);
const DeleteChannel = ({ id, deleteChannel }) => (
<Button
onClick={() => {
deleteChannel(id);
}}
>
×
</Button>
);
DeleteChannel.propTypes = {
id: PropTypes.string.isRequired,
deleteChannel: PropTypes.func.isRequired
};
const DeleteChannelWithMutation = graphql(
deleteChannelMutation, {
props: ({ mutate }) => ({
deleteChannel: id => mutate({
variables: {
id
},
// deleteChannel为该mutation返回的数据
update: (cache, { data: { deleteChannel, loading, error } }) => {
if (error) {
console.log('add card fail');
} else if (deleteChannel) {
console.log('add card success');
}
},
refetchQueries: [{ query: channelsListQuery }],
})
}),
}
)(DeleteChannel);
class ChannelsList extends React.Component {
state = {
selectedChannelId: null
}
handleSelectChannel = (id) => {
this.setState({ selectedChannelId: id });
}
render() {
const { channelsListData, serverAddressData } = this.props;
if (channelsListData.loading || serverAddressData.loading) {
return <p>Loading ...</p>;
}
if (channelsListData.error || serverAddressData.error) {
return <p>{channelsListData.error.message}</p>;
}
console.log('serverAddress:', serverAddressData.serverAddress);
const { selectedChannelId } = this.state;
const optimisticStyle = { color: 'rgba(255, 255, 255, 0.5)' };
return (
<ChannelsContainer>
<AddChannelWithMutations />
<Ul>
{
channelsListData.channels.map(ch => (
<LineContainer key={ch.id}>
<Li
onClick={() => this.handleSelectChannel(ch.id)}
style={ch.id < 0 ? optimisticStyle : null}
>
<Link to={ch.id < 0 ? `/example1` : `/example1/channel/${ch.id}`}>
{ch.name}
</Link>
</Li>
<DeleteChannelWithMutation id={ch.id} />
</LineContainer>
))
}
{
selectedChannelId && <SelectedChannel channelId={selectedChannelId} />
}
</Ul>
</ChannelsContainer>);
}
}
ChannelsList.propTypes = {
channelsListData: PropTypes.object.isRequired,
serverAddressData: PropTypes.object.isRequired,
};
// const ChannelsListWithData = graphql(channelsListQuery, {
// // options: { pollInterval: 500 } // 5s拉取一次数据
// })(ChannelsList);
const ChannelsListWithData = compose(
graphql(channelsListQuery, {
name: "channelsListData"
// options: { pollInterval: 500 } // 5s拉取一次数据
}),
graphql(serverAddressQuery, {
name: "serverAddressData"
}),
)(ChannelsList);
export default ChannelsListWithData;
|
import React, {Component} from 'react';
import {BottomNavigation, BottomNavigationItem} from 'material-ui/BottomNavigation';
import Paper from 'material-ui/Paper';
import MdIconLibraryBooks from 'material-ui/svg-icons/av/library-books';
import MdIconHome from 'material-ui/svg-icons/action/home';
import MdIconAccountCircle from 'material-ui/svg-icons/action/account-circle';
import './css/Bottom.css';
class Bottom extends Component {
constructor() {
super();
this.state = {
selectedIndex: 1
};
}
select(i) {
if (this.state.selectedIndex === i) {
return;
}
this.setState({selectedIndex: i});
this.props.mainApp.selectBottom(i);
}
render() {
return (
<Paper zDepth={1} className='Bottom'>
<BottomNavigation selectedIndex={this.state.selectedIndex}>
<BottomNavigationItem
icon={<MdIconLibraryBooks />}
onClick={() => this.select(0)}
/>
<BottomNavigationItem
icon={<MdIconHome />}
onClick={() => this.select(1)}
/>
<BottomNavigationItem
icon={<MdIconAccountCircle />}
onClick={() => this.select(2)}
/>
</BottomNavigation>
</Paper>
);
}
}
export default Bottom;
|
var map;
var layer;
var layerOptions;
var overlay;
var myLatLng;
MyOverlay.prototype = new google.maps.OverlayView();
function MyOverlay(image, center, options) {
this.image_ = image;
this.center_ = center;
this.options_ = options;
this.div_ = null;
if (options.map) {
this.setMap(options.map);
}
}
MyOverlay.prototype.onAdd = function() {
var img = document.createElement('img');
img.src = this.image_;
img.style.width = '100%';
img.style.height = '100%';
var div = document.createElement('div');
div.style.position = 'absolute';
div.appendChild(img);
this.div_ = div
var panes = this.getPanes();
panes.overlayImage.appendChild(this.div_);
};
MyOverlay.prototype.draw = function() {
var overlayProjection = this.getProjection();
var center = overlayProjection.fromLatLngToDivPixel(this.center_);
var img = document.createElement('img');
img.src = this.image_;
var width = (this.options_.width) ? this.options_.width : img.width;
var height = (this.options_.height) ? this.options_.height : img.height;
var opacity = (this.options_.opacity) ? this.options_.opacity : 1.0;
var div = this.div_;
div.style.left = (center.x - width / 2) + 'px';
div.style.top = (center.y - height / 2) + 'px';
div.style.width = width + 'px';
div.style.height = height + 'px';
div.style.opacity = opacity;
if (this.options_.rotate) {
var d = this.options_.rotate;
div.style.transform = d;
div.style.webkitTransform = d;
div.style.msTransform = d;
}
};
MyOverlay.prototype.onRemove = function() {
this.div_.parentNode.removeChild(this.div_);
this.div_ = null;
};
MyOverlay.prototype.show = function() {
if (this.div_) {
this.div_.style.visibility = 'visible';
}
};
MyOverlay.prototype.hide = function() {
if (this.div_) {
this.div_.style.visibility = 'hidden';
}
};
MyOverlay.prototype.toggle = function() {
if (this.div_) {
if (this.div_.style.visibility === 'hidden') {
this.show();
} else {
this.hide();
}
}
};
MyOverlay.prototype.expand = function(mag) {
if (this.div_) {
var div = this.div_;
var width = parseFloat(div.style.width) * mag;
var height = parseFloat(div.style.height) * mag;
div.style.width = width + 'px';
div.style.height = height + 'px';
}
};
MyOverlay.prototype.shift = function(x, y) {
if (this.div_) {
var div = this.div_;
var left = parseFloat(div.style.left) + x;
var top = parseFloat(div.style.top) + y;
div.style.left = left + 'px';
div.style.top = top + 'px';
}
};
MyOverlay.prototype.rotate = function(d) {
if (this.div_) {
var div = this.div_;
var deg = (div.style.transform) ? parseInt(div.style.transform.match(/-?\d+/)) : 0;
var rotate = 'rotate(' + (deg + d) + 'deg)';
div.style.transform = rotate;
div.style.webkitTransform = rotate;
div.style.msTransform = rotate;
}
};
MyOverlay.prototype.setImage = function(url, width, height) {
if (this.div_) {
var div = this.div_;
div.style.width = width + 'px';
div.style.height = height + 'px';
var img = div.childNodes[0];
img.src = url;
}
};
function changeFilter(condition) {
if (condition != '') {
layerOptions.query.where = condition + ' > 0';
}
layer.setOptions(layerOptions);
}
// ( 1 )位置情報を取得します。
function getLocation(){
if (navigator.geolocation) {
// 現在の位置情報取得を実施 正常に位置情報が取得できると、
// successCallbackがコールバックされます。
navigator.geolocation.getCurrentPosition(successCallback, errorCallback);
} else {
alert("本ブラウザではGeolocationが使えません");
}
}
// ( 2 )位置情報が正常に取得されたら
function successCallback(pos) {
var x = pos.coords.latitude;
var y = pos.coords.longitude;
var marker = new google.maps.Marker({
position: new google.maps.LatLng(x, y),
icon: {
url: 'img/bluedot.png',
size: new google.maps.Size(100, 100)
}
});
marker.setMap(map);
}
function errorCallback(error) {
alert( "位置情報が許可されていません");
myLatLng = null;
}
function initMap() {
var center = new google.maps.LatLng(35.675581, 139.692387);
map = new google.maps.Map(document.getElementById('map'), {
center: center,
zoom: 12,
mapTypeId: google.maps.MapTypeId.TERRAIN
});
var ctaLayer = new google.maps.KmlLayer({
url: './kml/route.kml',
map: map
});
var srcUrl = './img/magritte2.png'
overlayOptions = {
width: 696,
height: 980,
opacity: 1.0,
rotate: 20
};
overlay = new MyOverlay(srcUrl, center, overlayOptions);
overlay.setMap(map);
layerOptions = {
query: {
select: 'latitude',
from: '1znknfE0Ae6tbzdKSE4Xma_8SmxgoeU7GleIw3D3K',
where: ''
},
options: {
styleId: 2,
templateId:2
}
};
layer = new google.maps.FusionTablesLayer(layerOptions);
layer.setOptions(layerOptions);
layer.setMap(map);
getLocation();
}
google.maps.event.addDomListener(window, 'load', initMap);
|
"use strict";
/**
* ToastJs.
* A simple Tudú implementation of a toast engine.
*
* @param {HTMLElement} container - The container element for
* all the toasts.
*/
function Toast(container) {
var container = container;
var className = 'toast';
/**
* Creates a simple basic toast.
*
* @param {string} text - The text of the toast.
*/
this.simple = function(text) {
var toast = createToast(text);
container.appendChild(toast);
// Deletes toast after 3000ms.
deleteToast(toast, 3000);
}
/**
* Creates an action toast.
*
* An acion toast contains text and an action button which
* calls a function.
*
* @param {string} text - The text of the toast.
* @param {string} buttonText - The text of the action button.
* @param {function} buttonAction - The function to fire when
* the action button is clicked.
*/
this.action = function(text, buttonText, buttonAction) {
var toast = createToast(text);
// Creates the action button
var button = createEl('button', buttonText, 'toast-action');
button.addEventListener('click', function() {
buttonAction();
container.removeChild(toast);
});
toast.appendChild(button);
container.appendChild(toast);
// Deletes toast after 3000ms.
deleteToast(toast, 3000);
}
/**
* Creates the HTML toast element.
*
* @param {string} text - The inner text of the element.
* @returns {HTMLElement} The toast as an HTML element.
*/
function createToast(text) {
var toast = createEl('div', '', className);
var toastText = createEl('span', text, 'toast-text');
toast.appendChild(toastText);
return toast;
}
/**
* Detele a toast after a time.
*
* @param {HTMLElement} toast - The toast element to delete.
* @param {number} delay - The delay time to delete the toast
* in milliseconds.
*/
function deleteToast (toast, delay) {
setTimeout(function() {
if (container.contains(toast)) {
container.removeChild(toast);
}
}, delay);
}
}
|
import { withRouter } from "react-router";
import React from "react";
import "../CSS/Setting.css";
class Setting extends React.Component {
handleToOpensourcePage = () => {
this.props.history.push("/opensource");
};
handleToTradeHistoryPage = () => {
this.props.history.push("/profileset");
};
handleToStoreDealPage = () => {
this.props.history.push("/store-deal");
};
handleToQandAPage = () => {
this.props.history.push("/qanda");
};
handleToContactPage = () => {
this.props.history.push("/contact");
};
handleToUnsubscribePage = () => {
this.props.history.push("/unsubscribe");
};
handleToStoreDealPage = () => {
this.props.history.push("/deal");
};
render() {
return (
<div>
<h1>設定</h1>
<h2 onClick={this.handleToStoreDealPage}>取引履歴</h2>
<h2 onClick={this.handleToTradeHistoryPage}>プロフィール設定</h2>
<h2 onClick={this.handleToQandAPage}>Q&A</h2>
<h2 onClick={this.handleToContactPage}>お問い合わせ</h2>
<h2 onClick={this.handleToOpensourcePage}>オープンソース</h2>
<h2>ログアウト</h2>
<h2 onClick={this.handleToUnsubscribePage}>退会について</h2>
</div>
);
}
}
export default withRouter(Setting);
|
'use strict';
define(['jquery', 'wdn'], function ($, WDN) {
$.noConflict(true);
var jQueryWarning = false;
Object.defineProperty(WDN, 'jQuery', {
configurable: false,
get: function get() {
if (!jQueryWarning) {
jQueryWarning = true;
if (console && console.warn) {
console.warn('Using jQuery via the WDN.jQuery property is deprecated. You should use require to access jQuery.');
}
}
return $;
}
});
return $;
});
|
import {STANDARD_SEMITONES, CENTS_PER_STANDARD_SEMITONE, transposeFrequency} from 'util/music';
import findBaseFrequency from './findBaseFrequency';
export default function findBaseFrequencies(semitones, rootFrequency) {
const frequencies = [];
for (let i = 0; i < semitones; i++) {
frequencies.push(findBaseFrequency(transposeFrequency(rootFrequency, i * CENTS_PER_STANDARD_SEMITONE * (STANDARD_SEMITONES / semitones))));
}
return frequencies;
}
|
const Berita = require(model + "pengguna/berita.model")
const KategoriBerita = require(model + "pengguna/kategori_berita.model")
const storage = require(base+'service/Storage');
async function index(req, res){
let data = await this.DB('SELECT * FROM pengguna.kategori_berita kb INNER JOIN pengguna.berita b ON kb.id_kategori_berita=b.kategori_berita_id INNER JOIN pengguna.users u ON b.user_id=u.id_user ORDER BY b.id_berita ASC');
this.responseSuccess({
code: 200,
status: true,
values: data.get(),
message: 'Data Berita berhasil di dapatkan'
})
}
async function store(req,res){
let request = req.body
this.validation(request, {
kategori_berita: 'required',
judul_berita: 'required',
tanggal: 'required|date',
foto: 'required',
deskripsi: 'required',
})
storage.putAs('foto_berita', req.body.foto[0].filename, req.body.foto[0].data)
await Berita.query().insert({
kategori_berita_id: request.kategori_berita,
user_id: req.users.id_user,
judul_berita: request.judul_berita,
tanggal_berita: request.tanggal,
foto_berita: req.body.foto[0].filename,
deskripsi: request.deskripsi
})
this.responseSuccess({
code:200,
status: true,
values: {},
message: 'Data Berita Berhasil di Simpan'
})
}
async function edit(req, res){
let data = await Berita.query().findById(req.params.id)
if(data){
this.responseSuccess({
code:200,
status:true,
values: data,
message: 'Data Berita Berhasi di Dapatkan'
})
}else{
this.responseSuccess({
code:400,
status:false,
values: {},
message: 'Data Berita Tidak di Temukan'
})
}
}
async function update(req,res){
let request = req.body
this.validation(request, {
kategori_berita: 'required',
judul_berita: 'required',
tanggal: 'required|date',
deskripsi: 'required',
})
if(req.body.foto){
storage.putAs('foto_berita', req.body.foto[0].filename, req.body.foto[0].data)
await Berita.query().update({
kategori_berita_id: request.kategori_berita,
user_id: req.users.id_user,
judul_berita: request.judul_berita,
tanggal_berita: request.tanggal,
foto_berita: req.body.foto[0].filename,
deskripsi: request.deskripsi
})
.where('id_berita', request.id)
}else{
await Berita.query().update({
kategori_berita_id: request.kategori_berita,
user_id: req.users.id_user,
judul_berita: request.judul_berita,
tanggal_berita: request.tanggal,
deskripsi: request.deskripsi
})
.where('id_berita', request.id)
}
this.responseSuccess({
code:200,
status:true,
values: {},
message: 'Data Berita Berhasil di Update'
})
}
async function destroy(req,res){
let hapus = await Berita.query().deleteById(req.params.id)
if(hapus){
this.responseSuccess({
code:200,
status:true,
values: {},
message: 'Data Berita Berhasil di Hapus'
})
}else{
this.responseError({
code:400,
status: false,
values: {},
message: 'Data Berita Gagal di Hapus'
})
}
}
async function ddlKategoriBerita(req,res){
let data = await KategoriBerita.query()
this.responseSuccess({
code:200,
status:true,
values: data,
message: 'Data Kategori Berita Berhasil di Dapatkan'
})
}
async function show(req,res){
let data = await this.DB('SELECT * FROM pengguna.kategori_berita kb INNER JOIN pengguna.berita b ON kb.id_kategori_berita=b.kategori_berita_id WHERE id_berita=$1', [req.params.id]);
this.responseSuccess({
code: 200,
status: true,
values: data.get(),
message: 'Data Berita berhasil di dapatkan'
})
}
module.exports = {
index, store, ddlKategoriBerita, edit, destroy, update, show
}
|
import React from 'react';
const BannerTitle1 = () => {
return (
<h1 className='header-title'>
Odkryj siebie <span>na nowo</span> razem z naszą <span>kolekcją</span> mody
</h1>
);
}
export default BannerTitle1;
|
import React, { Component, propTypes } from 'react';
import './scores.css';
import Apphead from '../apphead/apphead.js';
import Element from './scoresview.js';
const league = [
{ name: 'RPL', url: 'databox.json' },
{ name: 'EPL', url: './epl.json' },
{ name: 'LL', url: './LL.json' },
{ name: 'Bundesliga', url: './bundesliga.json' }
];
export default class Table extends Component {
constructor(props) {
super(props);
}
render() {
const ln = this.props.match.params.ln;
return (
<div className='table' id='table'>
<Apphead text = 'SIMPLE TABLE'/>
{league.map((item, index) => {
if (item.name === ln) {
// console.log(item.url);
return (<Element url = {item.url} key = {index} link = {ln}/>);
}
})
}
</div>
);
}
}
|
$(document).ready(function(){
$("#shop_id_ajax").change(function(){
var id = $(this).val();
$.ajax({
type: "POST",
url: BASE_URL + 'shop/get_shop_category/'+ id,
data: "ajax",
async: true,
success: function(data){
$("#shop_category_ajax").html(data);
}
})
});
$(document).on("click", ".product_submit", function() {
var product_source_id = $('#product_source_id').val();
var product_name = $('#product_name').val();
var product_cate = $('#shop_category_ajax').val();
//var price_original = $('#price_original').val();//giá vốn
var unit_price = $('#unit_price').val(); //giá gốc
var price_sale = $('#price_sale').val(); //giá bán
var weight = $('#weight').val();
//var product_landing_url = $('#product_landing_url').val();
if(product_name == '')
{
$("#product_name").focus();
showMsg("Vui lòng nhập tên sản phẩm!");
return false;
}
if(shop_type == 1){
if(weight == '')
{
$("#weight").focus();
showMsg("Vui lòng nhập trọng lượng sản phẩm!");
return false;
}
}
if(unit_price == '')
{
$("#unit_price").focus();
showMsg("Vui lòng nhập giá gốc sản phẩm!");
return false;
}
if(price_sale == '')
{
$("#price_sale").focus();
showMsg("Vui lòng nhập giá bán sản phẩm!");
return false;
}
});
$(document).on("click", ".j_product_child", function() {
var id = $(this).attr('data-id');//alert(id);
$.ajax({
type: "POST",
url: BASE_URL + 'product/ajaxGetProductGroup',
data: {id:id},
success: function(data){//alert(id);
var tabTop = '<table class="table table-striped table-bordered"><tbody>';
var tabBottom = '</tbody></table>';
$('#show_product_child'+id).html(tabTop+data+tabBottom);
$('.vertical_ajax').lightSlider({
gallery:true,
item:1,
vertical:true,
verticalHeight:155,
vThumbWidth:50,
thumbItem:4,
thumbMargin:4,
slideMargin:0
});
$(function() {
$('.click_advance').on('click', function() {
$(this).find('i').toggleClass('fa-chevron-circle-down fa-chevron-circle-up');
});
});
}
});
});
$(document).on("click", "#product_group_search", function() {
var key_search = $('#key_search').val();
var shop_id = $('#shop_id').val();
var id = $('#ps_id').val();
if(key_search == '')
{
$("#key_search").focus();
showMsg("không được để trống từ khóa tìm kiếm!");
return false;
}
$.ajax({
type: "POST",
url: BASE_URL + 'product/product_group_search',
data: {key_search:key_search, shop_id:shop_id,id:id},
success: function(data){
$('#product_group_show').html(data);
}
});
});
$(document).on("click", ".j_product_the_kho", function() {
var id = $(this).attr('data-id');//alert(id);
$.ajax({
type: "POST",
url: BASE_URL + 'product/ajax_the_kho',
data: {id:id},
success: function(data){//alert(id);
$('#show_the_kho'+id).html(data);
}
});
});
/*
$(document).on("click", ".j_product_ton_kho", function() {
var id = $(this).attr('data-id');//alert(id);
$.ajax({
type: "POST",
url: BASE_URL + 'product/ajax_ton_kho',
data: {id:id},
success: function(data){//alert(id);
$('#show_ton_kho'+id).html(data);
}
});
});
*/
$(document).on("click", ".click-ton-kho", function() {
var id = $(this).attr('data-click-id');
$('#drop-product'+id).click();
$.ajax({
type: "POST",
url: BASE_URL + 'product/ajax_ton_kho',
data: {id:id},
success: function(data){//alert(id);
$('#drop-product'+id).click();
$('#show_ton_kho'+id).html(data);
}
});
});
$(document).on("click", "#product_submit", function() {
//var logo_size = document.getElementById('product_logo').files[0];
var product_source_id = $('#product_source_id').val();
var product_name = $('#product_name').val();
//var product_landing_url = $('#product_landing_url').val();
if(product_name == '')
{
$("#product_name").focus();
showMsg("Vui lòng nhập tên sản phẩm!");
return false;
}
else{
$("#message_show").html('');
}
if(typeof logo_size !== "undefined"){
if(logo_size.size > 100000)
{
$("#product_logo").focus();
showMsg("Ảnh upload vượt quá kích thước cho phép 100kb, vui lòng kiểm tra lại!");
return false;
}
else{
$("#message_show").html('');
}
}
var data = jQuery.parseJSON(
jQuery.ajax({
url: BASE_URL + 'product/check_product_code?id='+ product_id + '&product_code='+product_source_id,
async: false,
dataType: 'json'
}).responseText
);
if(data.error)
{
$("#product_source_id").focus();
showMsg(data.msg);
return false;
}
else{
$("#message_show").html('');
}
});
$(document).on("change", "#product_change_status", function() {
var id = $(this).attr('rel');
var status = $(this).val();
$.ajax({
type: "POST",
url: BASE_URL + 'product/product_change_status',
data: {id:id, status:status},
async: true,
success: function(response){
if(!response.error){
showMsg(response.msg,'success');
}
else
showMsg(response.msg);
}
});
});
$(document).on("click", ".product_delete", function() {
var id = $(this).attr('data-id');
//var status = $(this).val();
$.ajax({
type: "POST",
url: BASE_URL + 'product/product_delete',
data: {id:id},
success: function(response){
if(!response.error){
//showMsg(response.msg,'success');
$('table .product-'+id).remove();
}
else
showMsg(response.msg);
}
});
});
$(document).on("change", "#aff_type_ajax", function() {
var aff_type = $(this).val()
if(aff_type == 'CPL' || aff_type == 'CPO') {
$('#rate_label').html("Aff Money");
$('#rate_label_span').html("đ");
$('#aff_money_ajax').show();
$('#aff_rate_ajax').hide();
$('#rate_percent').hide();
$('#rate_vnd').show();
} else {
$('#rate_label').html("Aff Rate");
$('#rate_label_span').html("%");
$('#aff_rate_ajax').show();
$('#aff_money_ajax').hide();
$('#rate_percent').show();
$('#rate_vnd').show();
}
});
$(document).on("click", "#product_rate_submit", function() {
var product_id = $(this).attr("rel");
var aff_type = $("#aff_type_ajax").val();
var aff_rate = $("#aff_rate").val();
if(aff_rate <= 0)
{
$("#aff_rate").focus();
$("#popup_msg").text("Giá trị hoa hồng phải lớn hơn 0!");
$("#popup_show_msg").show();
return false;
}else{
$("#aff_rate").blur();
$("#popup_msg").text("");
$("#popup_show_msg").hide();
}
if(aff_type == 'CPS') {
if($('input[name=aff_rate]:checked', '#popup_form').val() == 'rate_vnd'){
if(aff_rate < 10000){
$("#aff_rate").focus();
$("#popup_msg").text("Tiền hoa hồng phải lớn hơn 10.000 đ!");
$("#popup_show_msg").show();
return false;
}
else{
$("#aff_rate").blur();
$("#popup_msg").text("");
$("#popup_show_msg").hide();
}
}else{
if(aff_rate >= 100 || aff_rate <5){
$("#aff_rate").focus();
$("#popup_msg").text("Tỷ lệ hoa hồng phải lớn hơn 5 và nhỏ hơn hoặc bằng 100!");
$("#popup_show_msg").show();
return false;
}else{
$("#aff_rate").blur();
$("#popup_msg").text("");
$("#popup_show_msg").hide();
}
}
}
$.ajax({
type: "POST",
url: BASE_URL + 'product/update_product_propose?product_id='+ product_id + '&aff_type='+ aff_type + '&aff_rate='+ aff_rate,
data: "ajax",
async: true,
success: function(kq){
if(kq){
alert("Cập nhật thành công!");
}
}
});
});
$("#importForm").on('submit',(function(e){
e.preventDefault();
var market_cate_id = $('#market_cate_id').val();
if (market_cate_id == '') {
alert('Vui lòng chọn danh mục');
return false;
}
$.ajax({
url:BASE_URL + 'product/import',
type: "POST",
data: new FormData(this),
contentType: false,
cache: false,
processData:false,
beforeSend: function() {
$(".uploading").show();
},
success: function(data){
$('.uploading').hide();
$("#importModal").modal("hide");
alert(data);
location.reload();
},
error: function(){
alert(data);
}
});
}));
//Make script DOM ready
$('.att-select').on('change',function() { //jQuery Change Function
var opval = $(this).val(); //Get value from select element
if(opval=="checkAddAttributes"){
$(this).addClass("att-select-active");
$('#attModal').modal("show"); //Open Modal
}
});
//Make script DOM ready
$('#attModal').on('click', '#btn-att-add', function() {
var attAdd = $("#att-add").val();
if(attAdd !== ''){ //Compare it and if true
$('#attModal').modal("hide"); //close Modal
$('.att-select-active').append('<option value="'+attAdd+'" selected>'+attAdd+'<option>');
$('select').removeClass('att-select-active');
$('.att-select option').filter(function() {
return !this.value || $.trim(this.value).length == 0 || $.trim(this.text).length == 0;
})
.remove();
}
});
$(function() {
$('.product_js a').click(function() {
$(this).find('i').toggleClass('fa-chevron-circle-down fa-chevron-circle-up');
});
});
});
|
var React = require('react');
var ApiUtil = require('../util/api_util.js');
var IndexItem = React.createClass({
_onHover: function() {
ApiUtil.updateHoveredBench(this.props.id);
},
_offHover: function() {
ApiUtil.updateHoveredBench(null);
},
render: function() {
return (
<div onMouseEnter={this._onHover} onMouseLeave={this._offHover}>
{this.props.description}
</div>
)
}
});
module.exports = IndexItem;
|
const config = require("../config")
const db = require("../db")
const getDataFromDB = require("./getDataFromDB")
const pino = require("../pino")
const cleanDB = async board => {
pino.trace("cleanDB for board /%s/",board)
pino.fatal("cleanDB should not be called right now!!")
try{
const now = Date.now()
let cycleOps = await getDataFromDB(board,"cycle",0,now - config.cycleHistoryLength)
let hourOps = await getDataFromDB(board,"hour",0,now - config.hourHistoryLength)
cycleOps = cycleOps.map(el => ({
type: "del",
key: ["cycle",board,el[0]]
}))
hourOps = hourOps.map(el => ({
type: "del",
key: ["hour",board,el[0]]
}))
pino.warn("cleanDB would delete %j entries",cycleOps.length + hourOps.length)
/*
if(cycleOps.length || hourOps.length){
db.batch([...cycleOps,...hourOps], err => {
if (err) pino.error(err)
})
}
*/
}catch(err){
pino.error(err)
}
}
//module.exports = cleanDB
module.exports = () => false
|
// convert integer to string with filled 0s
// 2 => 002, 34 => 034
const toNumberLength = (value, len = 3) => {
const res = String(value)
let zeros = '',
diff = len - res.length
while(diff > 0) {
zeros += '0'
diff--
}
return zeros + res
}
/**
* Shuffles array in place. ES6 version
* @param {Array} a items An array containing the items.
*/
const shuffle = (arr = []) => {
for (let i = arr.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[arr[i], arr[j]] = [arr[j], arr[i]];
}
return arr
}
// here Array.fill does not work
// idk why......
const fillArray = (length, value) => {
const arr = []
while(length > 0) {
arr.push(value)
length--
}
return arr
}
module.exports = new function() {
var rooms = {},
existRoomIds = new Set([])
const convertIdToNumber = id => Number(id)
this.getRoom = id => rooms[id]
this.getAllRooms = () => rooms
// this.getRoomId = id => Number(id)
this.getAllRoomIds = () => [...existRoomIds]
this.getPlayers = roomId => (rooms[roomId] || {}).players
this.getPlayer = (roomId, index) => {
const players = this.getPlayers(roomId) || {}
const socketId = Object.keys(players).find(_p => players[_p].index === index)
return players[socketId]
}
this.generateNewRoom = (inputs = {}) => {
// get new room id
const existIdArray = [...existRoomIds].map(id => convertIdToNumber(id)).sort()
let newId = 1
const inorder = existIdArray.some((existId, index) => {
if(existId > index + 1) {
newId = index + 1
return true
}
return false
})
newId = inorder ? newId : existIdArray.length + 1
const _newId = toNumberLength(newId)
// get role distribution
// status: 0 - dead
// 1 - alive
// 2 - skill 1 (cure) used
// 3 - skill 2 (poison) used
const { villager, wolf, gods = [] } = inputs
const villagerPlayers = fillArray(villager, 'villager'),
wolfPlayers = fillArray(wolf, 'wolf')
const roles = [...villagerPlayers, ...wolfPlayers, ...gods]
shuffle(roles)
const newRoom = {
id: _newId,
createTime: new Date(),
roles,
players: {}
}
// manipulate rooms
existRoomIds.add(_newId)
rooms[_newId] = newRoom
return newRoom
}
this.deleteRoom = roomId => {
existRoomIds.delete(roomId)
delete rooms[roomId]
}
this.clearAllRoom = () => {
existRoomIds.clear()
rooms = {}
}
// play actions
// ---------------------------
this.sitDown = (roomId, socketId, userInfo, index) => {
const thisRoom = rooms[roomId]
if(thisRoom) {
thisRoom.players[socketId] = {
index,
role: thisRoom.roles[index],
status: 1,
socketId,
userInfo
}
}
}
this.updatePlayer = (roomId, socketId, property, index) => {
const thisRoom = rooms[roomId]
if(thisRoom) {
const _player = thisRoom.players[socketId]
thisRoom.players[socketId] = Object.assign({}, _player, property)
}
}
}
// init data storage
// rooms = {
// "roomId" : {
// id: "123456",
// roles: ['villager', 'seer', 'wolf',....]
// players: {
// "<socketId>": {
// role: 'villager',
// status: 1,
// socketId: 'SKDMOQW',
// userInfo: {....}
// },
// ....
// },
// ....
// ],
// createTime: Data(),
// }
// }
|
var parse = require('css-parse');
var Handle = function (css) {
this.styleSheet = parse(css);
this.handles = [];
this.finalHandle = new Function();
};
Handle.prototype.use = function (properties, func) {
if (arguments.length == 1) {
this.handles.push({
properties: '*',
func: arguments[0]
});
return;
}
this.handles.push(
{
properties: properties,
func: func
}
);
};
Handle.prototype.do = function () {
var json = {};
var self = this;
this.styleSheet.stylesheet.rules.forEach(function (rule) {
if (rule.type !== 'rule') return;
rule.selectors.forEach(function (selector) {
selector = selector.replace(/\.|#/g, '');
var styles = (json[selector] = json[selector] || {});
rule.declarations.forEach(function (declaration) {
if (declaration.type !== 'declaration') return;
var keys = [{
key: declaration.property,
value: declaration.value
}];
for (var i = 0; i < self.handles.length; i++) {
var properties = self.handles[i].properties;
if (properties == "*") {
self.handles[i].func(keys);
}
if (_indexOf(declaration.property, properties)) {
keys = self.handles[i].func(keys);
}
}
self.finalHandle(styles, keys);
});
});
}
);
return JSON.stringify(json, null, 4);
};
Handle.prototype.final = function (func) {
this.finalHandle = func;
};
function _indexOf(value, arr) {
var flag = false;
for (var i = 0; i < arr.length; i++) {
if (value === arr[i]) {
return true
}
}
return flag;
}
module.exports = Handle;
|
const { CryptoCoin } = require('../../../app/models');
const coinObjects = require('../objects/crypto_coins');
exports.addMultipleCoins = (userId = 1) => {
const coins = coinObjects.coinsArray.map(coin => ({ ...coin, userId }));
return CryptoCoin.bulkCreate(coins);
};
|
import React, { useContext, useEffect, useState } from "react";
import styled from "styled-components";
import { EmailsContext } from "../../stores/emails-store";
import CheckboxList from "./checkbox-list";
import CheckboxSummary from "./checkbox-summary";
import SelectInput from "./select-input";
const SelectBox = styled.div`
width: 216.72px;
margin-top: ${({ theme }) => theme.spaces[3]};
background: ${({ theme }) => theme.color.light};
border: ${({ theme }) => theme.borderWidths[0]} solid ${({ theme }) => theme.color.gray};
box-sizing: border-box;
border-radius: ${({ theme }) => theme.borderRadius};
`;
const SelectContainer = styled.div`
display: flex;
flex-direction: row;
position: relative;
height: 44.46px;
align-items: center;
padding: 0px ${({ theme }) => theme.spaces[2]};
`;
const SelectMultipleCheck = (props) => {
const { emails, setEmails } = useContext(EmailsContext);
const [expandedCheckboxList, setExpandedCheckBoxList] = useState(false);
const [allSelection, setAllSelection] = useState(1);
const handleAllSelection = () => {
let allTrue = true;
let allFalse = true;
emails[props.emailId].contactsSelection.forEach((item) => (item.selected ? (allFalse = false) : (allTrue = false)));
const updateAllselection = allTrue ? 1 : allFalse ? 0 : 2;
setAllSelection(updateAllselection);
};
const onShowCheckboxList = () => {
if (expandedCheckboxList) {
setExpandedCheckBoxList(false);
} else {
setExpandedCheckBoxList(true);
}
};
const onSelectAll = () => {
const updatedAllselection = allSelection === 1 ? 0 : 1;
setAllSelection(updatedAllselection);
emails[props.emailId].contactsSelection = emails[props.emailId].contactsSelection.map((item) => {
item.selected = updatedAllselection;
return item;
});
setEmails({ ...emails });
};
const onCheckboxChange = (index) => {
emails[props.emailId].contactsSelection[index].selected = !emails[props.emailId].contactsSelection[index].selected;
setEmails({ ...emails });
handleAllSelection();
};
const handleAllSelectionCheckbox = () => {
let checkbox = document.getElementById(props.id + "-checkbox-all-selection");
switch (allSelection) {
case 0:
checkbox.checked = false;
checkbox.indeterminate = false;
break;
case 1:
checkbox.checked = true;
checkbox.indeterminate = false;
break;
default:
checkbox.checked = false;
checkbox.indeterminate = true;
break;
}
};
const handleSelectionContacts = () => {
emails[props.emailId].contactsSelection = emails[props.emailId].contacts.map((item) => {
return { label: item, selected: true };
});
setEmails({ ...emails });
setAllSelection(1);
};
useEffect(handleAllSelectionCheckbox, [allSelection, props.id]);
useEffect(handleSelectionContacts, [emails[props.emailId].contacts]); // eslint-disable-line react-hooks/exhaustive-deps
return (
<SelectBox>
<SelectContainer>
<CheckboxSummary type="checkbox" id={props.id + "-checkbox-all-selection"} key={"checkbox-all-selection"} onChange={() => onSelectAll()} />
<SelectInput id={props.id + "-select"} expanded={expandedCheckboxList} onClick={() => onShowCheckboxList()}></SelectInput>
</SelectContainer>
<CheckboxList id={props.id + "-checkbox"} expanded={expandedCheckboxList} labelList={emails[props.emailId].contactsSelection} onChange={(index) => onCheckboxChange(index)}></CheckboxList>
</SelectBox>
);
};
export default SelectMultipleCheck;
|
const { TestWatcher } = require("@jest/core");
const Employee = require("../lib/Employee.js");
test("can set name via constructor argument", () => {
const testName = "Danny";
const a = new Employee(testName);
expect(a.name).toBe(testName);
});
test("can set id via constructor argument", () => {
const testId = 3;
const a = new Employee("Danny", testId);
expect (a.id).toBe(testId);
});
test("can set email via constructor argument", () => {
const testEmail = "test@example.com";
const a = new Employee("Danny", 3, testEmail);
expect (a.email).toBe(testEmail);
});
test("can get name via getName()", () => {
const testName = "Danny";
const a = new Employee(testName);
expect(a.getName()).toBe(testName);
});
test("can get id via getId()", () => {
const testId = 3;
const a = new Employee("Danny", testId);
expect (a.getId()).toBe(testId);
});
test("can get email via getEmail()", () => {
const testEmail = "test@example.com";
const a = new Employee("Danny", 3, testEmail);
expect (a.getEmail()).toBe(testEmail);
});
test("can get role via getRole()", () => {
const testRole = "Employee";
const a = new Employee(testRole);
expect (a.getRole()).toBe(testRole);
});
|
let express = require('express'),
app = express(),
request = require('request'),
port = process.env.PORT || 3000;
//Settings
app.set("view engine","ejs");
app.use(express.static(__dirname+ "/public"));
//Routes
let landingRoute = require('./routes/landing');
let optionsRoute = require('./routes/options')
app.use(landingRoute);
app.use(optionsRoute);
app.listen(process.env.PORT || 3000, function(){
console.log("NewsApp Started")
});
|
// Create a new date instance dynamically with JS
let d = new Date();
let newDate = d.getMonth()+'.'+ d.getDate()+'.'+ d.getFullYear();
// Personal API Key for OpenWeatherMap API
const apiKey = '01a0aa6f1009f8f5b17fb28c08c6c55e'
// Event listener to add function to existing HTML DOM element
const generate = document.getElementById('generate')
generate.addEventListener('click', event => {
const city = document.getElementById('city').value
const feelings = document.getElementById('feelings').value
getWeatherData(city)
.then(response => response.json())
.then(json => {
const body = {}
body.temp = json.main.temp
body.icon = json.weather[0].icon
body.date = newDate
body.content = feelings
body.city = city
console.log(json);
return postData(body)
})
.then(response => {
updateData()
})
.catch(error => {
console.log(error)
console.log('weather api call error')
});
})
/* Function to GET Web API Data*/
const getWeatherData = async (city) => {
const url = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=imperial`
return fetch(url)
}
/* Function to POST data */
const postData = async (content) => {
//async function to call post endpoint on backend
const url = `http://localhost:8000/add`
return fetch(url, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(content)
});
}
/* Function to Update Project Data on DOM*/
const updateData = async () => {
getData()
.then(response => response.json())
.then(entries => {
const list = document.getElementById('list');
// cleam the children of the list
list.querySelectorAll('.entryHolder').forEach(node => node.remove());
// builds entry list
for(let entry of entries.reverse()) {
const entryHolder = document.createElement('div');
const city = document.createElement('div');
const date = document.createElement('div');
const temp = document.createElement('div');
const content = document.createElement('div');
const icon = document.createElement('img');
entryHolder.classList.add('entryHolder');
city.classList.add('city');
date.classList.add('date');
temp.classList.add('temp');
icon.classList.add('icon');
content.classList.add('content');
city.innerHTML = entry.city;
date.innerHTML = entry.date;
temp.innerHTML = `${entry.temp} °F`;
icon.setAttribute('src', `http://openweathermap.org/img/wn/${entry.icon}@2x.png`)
content.innerHTML = entry.content;
list.appendChild(entryHolder);
entryHolder.appendChild(city);
entryHolder.appendChild(date);
entryHolder.appendChild(temp);
entryHolder.appendChild(icon);
entryHolder.appendChild(content);
}
})
}
/* Function to GET Project Data */
const getData = async () => {
//TODO async function pra chamar o GET /all no backend
const url = `http://localhost:8000/all`
return fetch(url)
}
updateData();
|
import React, {Component} from 'react';
import Zahlavi from '../rozlozeni/Zahlavi';
import Zapati from '../rozlozeni/Zapati';
export default class ONas extends Component {
mockA = {
odkaz: "http://portal.chmi.cz/",
obr: "./obrazky/reference/160px-CHMI_logo.svg.png",
popis: "Webové stránky českého hydrometeorologického ústavu",
spolecnost: "ČHMÚ"
};
mockB = {
odkaz: "https://anexia.cz/",
obr: "./obrazky/reference/anexia-logo.png",
popis: "Webové stránky společnosti ANEXIA s.r.o.",
spolecnost: "ANEXIA s.r.o."
};
mockC = {
odkaz: "http://www.hamrsport.cz/cs/",
obr: "./obrazky/reference/hamr-sport-logo.png",
popis: "Webové stránky společnosti Hamr Sport, a. s.",
spolecnost: "Hamr Sport, a. s."
};
componentDidMount() {
document.title = "O společnosti TEZA MV";
}
refText() {
return (
<div>
<p>
Naše společnost byla založena v roce 2000 a od té doby prodáváme na trhu kvalitní sortiment s více
jak šestnáctiletou praxí. Naší prioritou jsou spokojení zákazníci, proto se snažíme se přizpůsobit
širokému portfoliu klientů, již jsou s naší spoluprací spokojeni.
</p>
<p>
Díky rozsáhlým zkušenostem na trhu jsme schopni pro Vás navrhnout taková řešení, která nezatíží Váš
rozpočet a pomohou Vám ve Vašem podnikání. Naší prioritou je udržování nabídky vysoce kvalitního
sortimentu za nízké ceny, krátké dodací lhůty a přímá a férová komunikace.
</p>
</div>
);
}
renderRefPanel(dataReference) {
return (
<div className="onas-panel-reference-polozka">
<a href={dataReference.odkaz} target="_blank">
<div className="onas-panel-reference-obr-kontejner">
<img src={dataReference.obr} aria-label={dataReference.popis} alt={dataReference.popis}/>
</div>
<div>{dataReference.spolecnost}</div>
</a>
</div>
);
}
getReference() {
const nadpis = <h2>Mezi naše stálé zákazníky patří společnosti</h2>;
return (
<div>
{nadpis}
<div className="onas-panel-reference-hlavni">
<div className="onas-panel-reference">
{this.renderRefPanel(this.mockA)}
{this.renderRefPanel(this.mockB)}
{this.renderRefPanel(this.mockC)}
</div>
</div>
</div>
);
}
getZakladniInfo() {
return (
<div>
<h2>Základní údaje o společnosti</h2>
<table>
<tbody>
<tr>
<td className="onas-panel-reference-tabulka-tucne">Jméno</td>
<td>TEZA MV s.r.o</td>
</tr>
<tr>
<td className="onas-panel-reference-tabulka-tucne">IČ</td>
<td>26162644</td>
</tr>
<tr>
<td className="onas-panel-reference-tabulka-tucne">DIČ</td>
<td>CZ26162644</td>
</tr>
<tr>
<td className="onas-panel-reference-tabulka-tucne">Sídlo</td>
<td>Náměstí Osvoboditelů 1362, Praha 5 - Radotín, 155 00</td>
</tr>
</tbody>
</table>
<p>
Společnost zapsaná v obchodním rejstříku vedeném Městským soudem v Praze pod spisovou značkou C
75849
</p>
</div>
)
}
render() {
return (
<div>
<Zahlavi/>
<div className="panel">
<h1>O společnosti TEZA MV, s.r.o.</h1>
{this.refText()}
{this.getReference()}
{this.getZakladniInfo()}
</div>
<Zapati/>
</div>
);
}
}
|
import {
GraphQLList,
GraphQLFloat,
GraphQLObjectType,
GraphQLEnumType,
GraphQLInputObjectType,
GraphQLString
} from 'graphql'
export const GeometryEnum = new GraphQLEnumType({
name: 'GeometryEnum',
values: {
Point: {
value: 'Point'
},
Polygon: {
value: 'Polygon'
},
Linestring: {
value: 'Linestring'
},
MultiPoint: {
value: 'MultiPoint'
},
MultiLineString: {
value: 'MultiLineString'
},
MultiPolygon: {
value: 'MultiPolygon'
},
Feature: {
value: 'Feature'
},
FeatureCollection: {
value: 'FeatureCollection'
}
}
})
const coordinates = new GraphQLList(
new GraphQLList(new GraphQLList(GraphQLFloat))
)
export const GeometryPropertiesInput = new GraphQLInputObjectType({
name: 'GeometryPropertiesInput',
fields: {
name: {
type: GraphQLString
}
}
})
export const GeometryInput = new GraphQLInputObjectType({
name: 'GeometryInput',
fields: {
type: {
type: GeometryEnum
},
coordinates: {
type: coordinates
}
}
})
export const FeatureInput = new GraphQLInputObjectType({
name: 'FeatureInput',
fields: {
type: {
type: GeometryEnum
},
geometry: {
type: GeometryInput
},
properties: {
type: GeometryPropertiesInput
}
}
})
export const FeatureCollectionInput = new GraphQLInputObjectType({
name: 'FeatureCollectionInput',
fields: {
type: {
type: GeometryEnum
},
features: {
type: new GraphQLList(FeatureInput)
},
properties: {
type: GeometryPropertiesInput
}
}
})
const geometryProperties = new GraphQLObjectType({
name: 'geometryProperties',
fields: () => ({
name: {
type: GraphQLString
}
})
})
const geometry = new GraphQLObjectType({
name: 'geometry',
fields: () => ({
type: {
type: GeometryEnum
},
coordinates: {
type: coordinates
}
})
})
const feature = new GraphQLObjectType({
name: 'feature',
fields: () => ({
type: {
type: GeometryEnum
},
geometry: {
type: geometry
},
properties: {
type: geometryProperties
}
})
})
const featureCollection = new GraphQLObjectType({
name: 'featureCollection',
fields: () => ({
type: {
type: GeometryEnum
},
properties: {
type: geometryProperties
},
features: {
type: new GraphQLList(feature)
}
})
})
export default featureCollection
|
import React, { Component } from 'react'
import {db} from '../firebase'
import MappBar from './mAppBar'
class CourseDetails extends Component {
state = {
eligibility:null,
title:null,
price:null,
image:null
}
componentDidMount(){
const data = db.collection("Classes").doc(this.props.match.params.id).collection("Courses").doc(this.props.match.params.doc)
data.get().then(snapshot => {
var title = snapshot.get('title')
var price = snapshot.get('price')
var image = snapshot.get('image')
this.setState({title:title}); this.setState({price:price}); this.setState({image:image})
})
const elegibility = db.collection("Classes").doc(this.props.match.params.id).collection("Courses").doc(this.props.match.params.doc).collection("details")
elegibility.get().then(snapshot => {
const item = []
snapshot.forEach(doc => {
const data = doc.data()
item.push(data)
})
this.setState({ eligibility: item })
})
}
render() {
return (
<div className="mobile" style={{minHeight:"100vh"}} >
<MappBar/>
<div className="wrap" style={{paddingTop:"50px",paddingBottom:'10px'}} >
<img alt="" src={this.state.image} width="70%" ></img>
</div>
<div className="wrap" >
<h2>{this.state.title}</h2>
</div>
<ul>
{
this.state.eligibility&&
this.state.eligibility.map(item=>{
return <li>{item.item}</li>
})
}
</ul>
<div style={{ width: '100%', textAlign: 'center', color: 'lightgrey', fontSize: '10px', marginBottom: '10px',margin:'10px 0px'}} >
Pidgin
</div>
</div>
)
}
}
export default CourseDetails
|
export const SET_NAME = 'SET_NAME';
export const SET_AGE = 'SET_AGE';
export const HOME_LIST = 'HOME_LIST';
|
'use strict'
/**
* Dot notation field test
**/
var _ = require('lodash'),
hooks = require('../test-helper/drop-create-hooks'),
should = require('should'),
async = require('async'),
models = require('../test-helper/models'),
DottedModel = models.DottedModel,
DottedScopedModel = models.DottedScopedModel
describe('Dot notation test', function() {
describe('Simple Dotted Model', function() {
hooks()
it('#1 - simple add', function(done) {
new DottedModel({
name: 'SpongeBob',
info: {
title: 'Happy Day',
subtitle: 'All day long with jellyfish'
}
}).save(function(err, doc) {
if (err) {
throw err
}
doc.config.slug.should.equal('happy-day')
done()
})
})
it('#2 - simple edit', function(done) {
var id
async.series(
[
// Add
function(next) {
new DottedModel({
name: 'SpongeBob',
info: {
title: 'Scarry Day',
subtitle: 'All day long with Mrs. Puff'
}
}).save(function(err, doc) {
if (err) {
throw err
}
doc.config.slug.should.equal('scarry-day')
id = doc.id
next()
})
},
// Find and Edit
function(next) {
DottedModel.findById(id, function(err, doc) {
doc.info.title = 'Good Day'
doc.save(function(err1, doc1) {
// Assert new value
doc1.config.slug.should.equal('good-day')
// Assert history
doc1.config.slugs[0].should.equal('scarry-day')
next()
})
})
}
],
done
)
})
it('#3 - find one and update then findBySlug', function(done) {
var id
async.series(
[
// Add
function(next) {
new DottedModel({
name: 'SpongeBob',
info: {
title: 'Great Day',
subtitle: 'All day long with Squidward'
}
}).save(function(err, doc) {
if (err) {
throw err
}
doc.config.slug.should.equal('great-day')
id = doc.id
next()
})
},
// Find and Edit
function(next) {
DottedModel.findOneAndUpdate(
{ _id: id },
{
info: {
title: 'Mad Day',
subtitle: 'All day long with Patrick'
}
},
{ new: true },
function(err, doc) {
// Assert new value
doc.config.slug.should.equal('mad-day')
// Assert history
doc.config.slugs[0].should.equal('great-day')
next(err)
}
)
},
// findBuSlug #1
function(next) {
DottedModel.findBySlug('great-day', function(err, doc) {
doc.id.should.equal(id)
next(err)
})
},
// findBuSlug #2
function(next) {
DottedModel.findBySlug('mad-day', function(err, doc) {
doc.id.should.equal(id)
next(err)
})
}
],
done
)
})
})
describe('Scoped Dotted Model', function() {
hooks()
var id1, id2
it('#1 - simple add', function(done) {
async.series(
[
function(next) {
new DottedScopedModel({
name: 'SpongeBob',
info: {
title: 'Happy Day',
subtitle: 'All day long with jellyfish'
},
group: {
name: 'G1'
}
}).save(function(err, doc) {
if (err) {
throw err
}
doc.config.slug.should.equal('happy-day')
next()
})
},
function(next) {
new DottedScopedModel({
name: 'SpongeBob',
info: {
title: 'Happy Day',
subtitle: 'All day long with jellyfish'
},
group: {
name: 'G1'
}
}).save(function(err, doc) {
if (err) {
throw err
}
doc.config.slug.should.equal('happy-day-2')
next()
})
},
function(next) {
new DottedScopedModel({
name: 'SpongeBob',
info: {
title: 'Happy Day',
subtitle: 'All day long with jellyfish'
},
group: {
name: 'G2'
}
}).save(function(err, doc) {
if (err) {
throw err
}
doc.config.slug.should.equal('happy-day')
next()
})
}
],
done
)
})
it('#2 - simple edit', function(done) {
var id1, id2
async.series(
[
// Add to scope 1
function(next) {
new DottedScopedModel({
name: 'SpongeBob',
info: {
title: 'Scarry Day',
subtitle: 'All day long with Mrs. Puff'
},
group: {
name: 'G1'
}
}).save(function(err, doc) {
if (err) {
throw err
}
doc.config.slug.should.equal('scarry-day')
id1 = doc.id
next()
})
},
// Add to scope 2
function(next) {
new DottedScopedModel({
name: 'SpongeBob',
info: {
title: 'Scarry Day',
subtitle: 'All day long with Mrs. Puff'
},
group: {
name: 'G2'
}
}).save(function(err, doc) {
if (err) {
throw err
}
doc.config.slug.should.equal('scarry-day')
id2 = doc.id
next()
})
},
// Find and Edit scope 1
function(next) {
DottedScopedModel.findById(id1, function(err, doc) {
doc.info.title = 'Good Day'
doc.save(function(err1, doc1) {
// Assert new value
doc1.config.slug.should.equal('good-day')
// Assert history
doc1.config.slugs[0].should.equal('scarry-day')
next()
})
})
},
// Find and Edit scope 2
function(next) {
DottedScopedModel.findById(id2, function(err, doc) {
doc.info.title = 'Awesome Day'
doc.save(function(err1, doc1) {
// Assert new value
doc1.config.slug.should.equal('awesome-day')
// Assert history
doc1.config.slugs[0].should.equal('scarry-day')
next()
})
})
},
// Change scope on data 1 from 1 to 2
function(next) {
DottedScopedModel.findById(id1, function(err, doc) {
doc.info.title = 'Scarry Day'
doc.group.name = 'G2'
doc.save(function(err1, doc1) {
// Assert new value
doc1.config.slug.should.equal('scarry-day-2')
// Assert history
// doc1.config.slugs[0].should.equal('scarry-day')
next()
})
})
}
],
done
)
})
it('#3 - find one and update then findBySlug', function(done) {
var id
async.series(
[
// Add data on G1
function(next) {
new DottedScopedModel({
name: 'SpongeBob',
info: {
title: 'Great Day',
subtitle: 'All day long with Squidward'
},
group: {
name: 'G1'
}
}).save(function(err, doc) {
if (err) {
throw err
}
doc.config.slug.should.equal('great-day')
id = doc.id
next()
})
},
// Add data on G2
function(next) {
new DottedScopedModel({
name: 'SpongeBob',
info: {
title: 'Mad Day',
subtitle: 'All day long with Squidward'
},
group: {
name: 'G2'
}
}).save(function(err, doc) {
if (err) {
throw err
}
doc.config.slug.should.equal('mad-day')
next()
})
},
// Find and Edit (Move first data from G1 to G2)
function(next) {
DottedScopedModel.findOneAndUpdate(
{ _id: id },
{
info: {
title: 'Mad Day',
subtitle: 'All day long with Patrick'
},
group: {
name: 'G2'
}
},
{ new: true },
function(err, doc) {
// console.log(doc)
// Assert new value
doc.config.slug.should.equal('mad-day-2')
// Assert history
doc.config.slugs[0].should.equal('great-day')
next(err)
}
)
},
// findBuSlug #1
function(next) {
DottedScopedModel.findBySlug('great-day', function(err, doc) {
doc.id.should.equal(id)
next(err)
})
},
// findBuSlug #2
function(next) {
DottedScopedModel.findBySlug('mad-day-2', function(err, doc) {
doc.id.should.equal(id)
next(err)
})
}
],
done
)
})
})
})
|
import React from 'react';
import './thread.css';
import { Link } from 'react-router-dom';
class ThreadBody extends React.Component {
render() {
return (<div className="article">
<Link to={'/post/'+this.props.postId}>
<div>
<div className="title">
<h3>{this.props.title}</h3>
</div>
<div className="date">
Submitted {this.props.date} by {this.props.user}
</div>
<div>
<ul className="social">
<li>
<i className="far fa-comment-alt"><span>5 comments</span></i>
</li>
<li>
<i className="far fa-share-square"><span>share</span></i>
</li>
<li>
<i className="far fa-bookmark"><span>save</span></i>
</li>
<li>
<i className="far fa-eye-slash"><span>hide</span></i>
</li>
<li>
<i className="far fa-flag"><span>report</span></i>
</li>
</ul>
</div>
</div>
</Link>
</div>)
}
}
export default ThreadBody;
|
'use strict'
const Config = use('Config')
const ResponseHelper = use('ResponseHelper')
const StudentRepository = use('StudentRepository')
class AddController {
async add ({ request, response, transform }) {
// Get request body
const studentDetails = request.only(['user_id', 'school_id', 'name', 'phone_number', 'email',
'source_of_funds', 'source_of_funds_description', 'student_number',
'date_of_birth', 'place_of_birth', 'present_address', 'permanent_address'])
// Process
let student = await transform.item(StudentRepository.add(studentDetails), 'StudentTransformer')
// Set response body
const responseStatus = Config.get('response.status.success')
const responseCode = Config.get('response.code.success.student.add')
const responseData = student
const responseBody = ResponseHelper.formatResponse(response, responseStatus, responseCode, responseData)
return responseBody
}
}
module.exports = AddController
|
var keystone = require('keystone');
//var handlebars = require('')
var handlebars = require('handlebars');
handlebars.registerHelper('splitDesc', function(description) {
var description = description.split("\r\n");
var final = '';
for (var i= 0 ; i < description.length ; i++){
final = final + "<p>" + description[i] + "</p>";
}
return (final);
//return handlebars.SafeString("test", description[0] + " <br/> " + description[1]);
//return description;
});
var aboutus = keystone.list('aboutus');
exports = module.exports = function(req,res){
var view = new keystone.View(req,res);
var locals = res.locals;
// console.log("Query is",req.query);
locals.section = 'aboutus';
locals.filters = {
inttitle: req.query.inttitle
}
var title = req.query.inttitle;
//console.log ('title is', title);
//console.log("Value of local tile",locals.filters.title);
// if (req.query.title = '')
// {
// req.query.title = 'society-for-development-of-suryanagar';
// }
if ( title == undefined )
{
view.query('aboutusdet', aboutus.model.find({inttitle : "SOC"}));
}
else
{
view.query('aboutusdet', aboutus.model.find({inttitle : req.query.inttitle }));
}
//locals.filters.title
// description_val = aboutusdet.description.split(/[\r\n]+/);
// description_val = description.split(".");
//console.log("data of ", aboutus );
view.render('aboutusdet');
}
|
import React, { useState, useEffect, useContext } from 'react'
import './Navbar.css'
import PersonIcon from '@material-ui/icons/Person';
import FavoriteBorderIcon from '@material-ui/icons/FavoriteBorder';
import SearchIcon from '@material-ui/icons/Search';
import { Link } from 'react-router-dom'
import { FirebaseContext } from '../firebase';
const MobileNavbar = () => {
const firebase = useContext(FirebaseContext)
const [userSession, setUserSession] = useState(null)
const handleClick = () => {
firebase.logOutUser()
}
useEffect(() => {
let listner = firebase.auth.onAuthStateChanged(user => {
user ? setUserSession(user) : setUserSession(null)
})
return () => {
listner()
}
}, [])
return (
<>
{/* mobile bottom tab */}
<nav className="d-block d-lg-none mobileBottomTab">
<div className="container-fluid d-flex align-items-center justify-content-center">
<ul className="d-flex justify-content-center bottomTab">
<li><Link to="/" className="d-flex flex-column justify-content-center align-items-center"><SearchIcon style={{ fontSize: 30, color: 'lightgrey' }} /><p>Recherche</p></Link></li>
<li><Link to="/Favoris" className="d-flex flex-column justify-content-center align-items-center"><FavoriteBorderIcon style={{ fontSize: 30, color: 'lightgrey' }} /><p>Favoris</p></Link></li>
{
userSession ? (
<>
<li><Link to="/Profil" className="d-flex flex-column justify-content-center align-items-center"><PersonIcon style={{ fontSize: 30, color: 'lightgrey' }} /><p>Profil</p></Link></li>
</>
) : (
<>
<li><Link to="/Connection" className="d-flex flex-column justify-content-center align-items-center"><PersonIcon style={{ fontSize: 30, color: 'lightgrey' }} /><p>Connection</p></Link></li>
</>
)
}
</ul>
</div>
</nav>
</>
)
}
export default MobileNavbar
|
var chalk = require('chalk');
var reporter = {
onSuccess: function(testName) {
console.log(chalk.green('Success: ' + testName + ' passed'));
},
onError: function(err) {
var failMessage = err.stack.split('\n')[0];
var lineOfFail = err.stack.split('\n')[2].replace(' at', '');
console.log(chalk.red(failMessage));
console.log(lineOfFail);
},
onAsyncTimeout: function(testName) {
console.log(chalk.red('Timeout error: async test ' + testName + ' did not complete in time.'));
}
};
module.exports = reporter;
|
/* $Rev: 739 $
* $HeadURL: http://source.innectus.com/svn/innectus/trunk/loom/App/build/js/jsheaderdev.txt $
* $Id: jsheaderdev.txt 739 2010-02-13 00:55:43Z tesanto $
*
* Copyright (C) 2009 Innectus Corporation
* All rights reserved
* This code is proprietary property of Innectus Corporation.
* Unauthorized use, distribution or reproduction is prohibited.
*/
(function(){
var _Base = INNECTUS.WidgetFactory.Widget;
var _DialogBox = INNECTUS.DialogBox;
var _structureEditor = null;
/**
* Registered as 'structure' in the group 'input'.
* This is the widget for drawing a structure.
* @class
* @augments INNECTUS.WidgetFactory.Widget
* @name INNECTUS.WidgetFactory.StructureWidgetInput
*/
function StructureWidgetInput(){
this._molData = null;
this.setHelpMessage("Double click on the image to bring up the structure editor.");
this._showChirality = true;
}
StructureWidgetInput.prototype = new _Base;
/**
* Be sure to look at Widget base class for more options.
* @function
* @name INNECTUS.WidgetFactory.StructureWidgetInput#init
* @param {Object} options Please look at Widget for more options. * @param {Number} [options.size=75] The size to render at.
* @param {Number} [opitons.size=75] The size of the widget.
*/
StructureWidgetInput.prototype.initInternal = function(options){
if(_structureEditor == null){
_structureEditor = new StructureEditor(_DialogBox.getWins());
}
this._structureEditor = _structureEditor;
if(options.size){
this.setSize(options.size);
} else if(this.getWidth() == null && this.getHeight() == null){
this.setSize(75);
}
};
StructureWidgetInput.prototype.detachParentInternal = function(){
INNECTUS.removeElement(this._button);
this._button = null;
this._renderer = null;
};
StructureWidgetInput.prototype.renderStatic = function(parent){
var that = this;
this._button = document.createElement("div");
this.appendCssClass(this._button, "inputBorder");
this._button.style.width = this.getSize() + "px";
this._button.style.height = this.getSize() + "px";
this._button.onmouseover = function(){
if(that._molData != null){
that._clearButton.show();
}
};
this._button.onmouseout = function(){
that._clearButton.hide();
};
this._button.ondblclick = function(){
that._structureEditor.setOnCloseCb(function(molData){
if(molData){
//update and redraw the value (thus setValue, and not updateValue).
//Call callbacks since this is a user input event.
that.setValue(molData.getData(),false);
}
});
that._structureEditor.showChirality(that._showChirality);
that._structureEditor.show(that._renderer.getMolUrl(), new MolData().init(that._molData));
};
parent.appendChild(this._button);
//custom buttons for a compound on mouse over
this._clearButton = new INNECTUS.FloatingButtons();
this._clearButton.init({
buttons:[
{
tip: "Clear!",
onImage: "/images/ico_del18x18.png",
offImage: "/images/ico_del_off18x18.png",
onClick: function(){
that._renderer.renderMolData(null);
that._molData = null;
that._clearButton.hide();
}
}
]
});
};
StructureWidgetInput.prototype.setSize = function(size){
this.setHeight(size);
this.setWidth(size);
}
StructureWidgetInput.prototype.getSize = function(){
var width = this.getWidth()-4;
var height = this.getHeight()-4;
if (width == null && height) {
return height;
} else if (height == null && width) {
return width;
} else {
return width <= height ? width : height;
}
}
StructureWidgetInput.prototype.renderValue = function(){
var molData = null;
if(this._molData){
molData = new MolData();
molData.init(this._molData);
}
if (this._renderer == null) {
this._renderer = new MolAjaxImage(this._button, molData, this.getSize());
} else {
this._renderer.renderMolData(molData);
}
this._clearButton.attachParent(this._button);
};
StructureWidgetInput.prototype.setValueInternal = function(value){
this._molData = value;
};
StructureWidgetInput.prototype.getValueInternal = function(){
return this._molData;
};
StructureWidgetInput.prototype.toTextStringInternal = function(){
return this._molData.smiles;
};
StructureWidgetInput.prototype.updateSize = function(){
if(this._renderer){
var size = this.getSize();
this._button.style.width = size + "px";
this._button.style.height = size + "px";
this._renderer.setSize(size, size);
}
}
StructureWidgetInput.prototype.setWidth = function(width){
_Base.prototype.setWidth.call(this, width);
this.updateSize();
};
StructureWidgetInput.prototype.setHeight = function(height){
_Base.prototype.setHeight.call(this, height);
this.updateSize();
};
INNECTUS.WidgetFactory.registerWidget(StructureWidgetInput, "input", "structure");
/**
* Registered as 'structure' in the group 'display'.
* This is the widget for read-only display of a structure.
* @class
* @augments INNECTUS.WidgetFactory.Widget
* @name INNECTUS.WidgetFactory.StructureWidgetInput
*/
function StructureWidgetDisplay(){
this._molData = null;
this._showChirality = true;
}
StructureWidgetDisplay.prototype = new _Base;
/**
* Be sure to look at Widget base class for more options.
* @function
* @name INNECTUS.WidgetFactory.StructureWidgetInput#init
* @param {Object} options Please look at Widget for more options.
* @param {Number} [options.size=75] The size to render at.
* @param {Number} [opitons.size=75] The size of the widget.
* @param {Array} [options.buttons] Floating buttons to display. Each button has four options: tip (string), onImage (url), offImage (url), onClick (function)
*/
StructureWidgetDisplay.prototype.initInternal = function(options){
if(options.size){
this.setSize(options.size);
} else if(this.getWidth() == null && this.getHeight() == null){
this.setSize(75);
}
if (options.buttons){
this._buttons = new INNECTUS.FloatingButtons();
this._buttons.init({buttons:options.buttons});
}
};
StructureWidgetDisplay.prototype.detachParentInternal = function(){
INNECTUS.removeElement(this._button);
this._button = null;
this._renderer = null;
};
StructureWidgetDisplay.prototype.renderStatic = function(parent){
var that = this;
this._button = document.createElement("div");
this.appendCssClass(this._button, "inputBorder");
this._button.style.width = this.getSize() + "px";
this._button.style.height = this.getSize() + "px";
this._button.onmouseover = function(){
if (that._buttons)
that._buttons.show();
};
this._button.onmouseout = function(){
if (that._buttons)
that._buttons.hide();
};
parent.appendChild(this._button);
};
StructureWidgetDisplay.prototype.setSize = function(size){
this.setHeight(size);
this.setWidth(size);
}
StructureWidgetDisplay.prototype.getSize = function(){
var width = this.getWidth()-4;
var height = this.getHeight()-4;
if (width == null && height) {
return height;
} else if (height == null && width) {
return width;
} else {
return width <= height ? width : height;
}
}
StructureWidgetDisplay.prototype.renderValue = function(){
var molData = null;
if(this._molData){
molData = new MolData();
molData.init(this._molData);
}
if (this._renderer == null) {
this._renderer = new MolAjaxImage(this._button, molData, this.getSize());
} else {
this._renderer.renderMolData(molData);
}
if (this._buttons)
this._buttons.attachParent(this._button);
};
StructureWidgetDisplay.prototype.setValueInternal = function(value){
this._molData = value;
};
StructureWidgetDisplay.prototype.getValueInternal = function(){
return this._molData;
};
StructureWidgetDisplay.prototype.toTextStringInternal = function(){
return this._molData.smiles;
};
StructureWidgetDisplay.prototype.updateSize = function(){
if(this._renderer){
var size = this.getSize();
this._button.style.width = size + "px";
this._button.style.height = size + "px";
this._renderer.setSize(size, size);
}
}
StructureWidgetDisplay.prototype.setWidth = function(width){
_Base.prototype.setWidth.call(this, width);
this.updateSize();
};
StructureWidgetDisplay.prototype.setHeight = function(height){
_Base.prototype.setHeight.call(this, height);
this.updateSize();
};
INNECTUS.WidgetFactory.registerWidget(StructureWidgetDisplay, "display", "structure");
}());
|
'use strict';
const gulp = require('gulp');
const ignore = require('gulp-ignore');
const istextorbinary = require('istextorbinary');
const conflict = require('gulp-conflict');
const installBinaryFiles = function (options) {
const src = options.src;
const srcDir = options.srcDir;
const destDir = options.destDir;
return function (cb) {
gulp.src(src, {cwd: srcDir, base: srcDir})
.pipe(ignore.include(file => istextorbinary.isBinarySync(file.basename, file.contents)))
.pipe(conflict(destDir, {logger: console.log}))
.pipe(gulp.dest(destDir))
.on('end', cb);
};
};
module.exports = installBinaryFiles;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.