text
stringlengths 7
3.69M
|
|---|
function Car (id,gaz) {
this.carId = id;
this.gaz = gaz;
this.start = function() {
console.log('start : ' + this.carId);
};
this.getGaz = () => this.gaz;
}
let car = new Car(123,'90%');
car.start();
console.log(car.getGaz());
let car2 = new Car(4,'70%');
car2.start();
Car.prototype.stop = function () {
console.log('Stop ' + this.carId);
};
car2.stop();
// for arrow func this refers to original context
String.prototype.hello = _ => this.toString() + ' Hello';
String.prototype.hello2 = function() {
return this.toString() + ' Hello';
};
console.log(' test1'.hello());
console.log(' test3'.hello2());
let heroDrag = {
id: 4,
attack: 5,
name: 'Dragon'
};
console.log(JSON.stringify(heroDrag));
let heroes = [
{id: 1, type: 'dragon'},
{id: 2, type: 'canon'},
{id: 3, type: 'aigle'},
{id: 4, type: 'canon'},
{id: null, type: 'elf'}
];
console.log(JSON.stringify(heroes));
let jsonIn =
`
[
{"id": 1},
{"id": 2},
{"id": 3}
]
`;
console.log(JSON.parse(jsonIn));
heroes.forEach(hero => console.log( hero));
heroes.forEach( (hero, index) => console.log( hero, index));
let canons = heroes.filter(
hero => hero.type === 'canon'
);
console.log(canons);
let result = heroes.every(
hero => hero.id > 0
);
console.log(result);
// find first element that matches condition
let someHero = heroes.find(
hero => hero.id > 2
);
console.log(someHero);
// find first canon
let firstCanon = heroes.find(
hero => hero.type === 'canon'
);
console.log(firstCanon);
|
var express = require('express');
var exphbs = require('express-handlebars');
var app = express();
app.set('port', process.env.PORT || 3000);
app.engine('handlebars', exphbs({
defaultLayout: 'main'
}));
app.set('view engine', 'handlebars');
app.use(express.static(__dirname + '/public'));
app.use('/vendor', express.static(__dirname + '/bower_components'));
app.get('/', function listen(req, res) {
res.render('home', {
title: 'Red Ironhack - Take me to Chicago'
});
});
app.use(function listen(req, res) {
res.status(404);
res.render('404', {
title: '404 - Page Not Found'
});
});
app.use(function listen(err, req, res, next) {
console.error(err.stack);
res.status(500);
res.render('500', {
title: '500 - Server Error'
});
});
app.listen(app.get('port'), function listen() {
console.log('Express is listening on port %s.', app.get('port'));
console.log('Strick Ctrl-c to terminate.');
});
|
import styled from "styled-components";
import { NavLink as Link } from "react-router-dom"
import {RiPlantLine} from "react-icons/ri"
export const Nav = styled.nav`
background : transparent;
height : 80px;
display : flex;
justify-content: center;
font-weight: 700;
`;
export const NavLink = styled(Link)`
color: #fff;
font-size : 2rem;
display: flex;
align-items: center;
text-decoration: none;
cursor: pointer;
@media screen and (max-weight: 400px){
position: absolute;
top: 10px;
left : 25px
}
`;
export const NavIcon = styled.div`
display: block;
position: absolute;
top: 2.5%;
right: 5%;
cursor: pointer;
color: #fff;
p{
transform: translate(-175%, -100%)
font-weight: bold;
font-size : 2rem;
}
`
export const Bars = styled(RiPlantLine)`
font-size: 2rem;
transform: translate(350%,-115%);
`
|
//** Returns a random id of length length
//:: Number length -> () -> String id
export default l => () => Math.random().toString(36).substr(2, l)
|
import React from 'react';
import StarIcon from '@material-ui/icons/Star';
const HotelCards = (props) => {
const {image, title, feature, details, rating, price} = props.hotelData;
return (
<>
<div className = 'hotel-img-section mt-3'><img src={image} alt=""/></div>
<div className = 'hotel-info mt-3'>
<h4>{title}</h4>
<p>{feature}</p>
<p className='mt-2'>{details}</p>
<h5><StarIcon fontSize="small" style={{ color: '#F9A51A' }} />{rating} {price}/ <span className='text-muted'>night $167 total</span></h5>
</div>
</>
);
};
export default HotelCards;
|
var SkypeTimeSlotsView = Backbone.View.extend({
template: HandlebarsTemplates['dashboard/skype_time_slots'],
render: function() {
var view_context = this;
var collection = new SkypeTimeSlots();
var promise = new Promise(function(resolve, reject) {
resolve(collection.fetch());
});
promise
.then(function(collection_objects) {
return collection_objects.sort(function (a, b) {
return a.ordertime - b.ordertime;
});
})
.then(function(collection_objects) {
return collection_objects.sort(function (a, b) {
return a.orderam - b.orderam;
});
})
.then(function(collection_objects) {
return collection_objects.sort(function (a, b) {
return a.orderday - b.orderday;
});
})
.then(function(collection_objects) {
$("#time-slot-template").remove();
var all_slots = collection_objects.length;
var num_slots_array = [];
for (i = 0; i < all_slots+1; i++) {
num_slots_array.push(i);
}
var hours_ahead = volunteerIsInDaylightSavingsTime() ? 11 : 12;
$("#list-avail-skype").after(
view_context.template({
no_time_slots: noTimeSlots(),
time_slots: collection_objects,
all_slots: num_slots_array,
hours_ahead: hours_ahead
})
);
function noTimeSlots() {
return collection_objects.length === 0;
}
}) // then
.catch(function(error) {
console.log(error);
});
}
});
|
import {
T,
and,
any,
apply,
call,
compose,
defaultTo,
gte,
length,
lte,
prop,
ifElse,
zipWith,
} from 'ramda'
//--
// A pair is an Array Number
// A mask is an Array Array Pair, with
//
// Specifically, it is a collection of [lower, upper] pair list
//
// A number is inside a pair
// if it satisfies:
// lower <= number <= upper
//
// A number is inside a pair list
// if it is inside at least one of the pairs
// A pair of numbers (i, j) are inside the mask
// if j is inside the ith pair list
//
// +/-Infinity are valid bounds
//
// @example [
// [[-Infinity, Infinity]],
// [[1, 3], [7, 9], [13, 15]]
// ]
//--
//** Returns wether i is in pair
//:: Number i, Pair pair -> Boolean inside
const insidePair =
i =>
compose(
apply(and), // both
zipWith(
call,
[
gte(i), // i >= lower bound
lte(i) // i <= upper bound
]
)
)
//** Returns wether i is in at least one of the pairs
//:: Number i -> Array Pair pairs -> Boolean inside
const insidePairs =
i =>
any(insidePair(i))
//** Returns wether j is in mask's ith pair list
//:: Number i, Number j, Mask mask -> Boolean inside
const inside =
i =>
j =>
({ mask, offsetI = 0, offsetJ = 0 }) =>
compose(insidePairs(j - offsetJ), defaultTo([]), prop(i - offsetI))(mask)
//** Returns wether j is in any masks's ith pair list
//:: Number i -> Number j -> Array masks -> Boolean inside
const insideAny =
i =>
j =>
compose(ifElse(length, any(inside(i)(j)), T), defaultTo([]))
export default {
inside,
insideAny,
}
|
/**
* Created by Khang @Author on 15/01/18.
*/
import axios from 'axios';
const REQ_DATA = 'REQ_DATA';
const RECV_DATA = 'RECV_DATA';
const RECV_ERROR = 'RECV_ERROR';
function requestData() {
return {type: REQ_DATA}
};
function receiveData(json) {
return{
type: RECV_DATA,
data: json
}
};
function receiveError(json) {
return {
type: RECV_ERROR,
data: json
}
};
export function fetchData() {
return function(dispatch) {
dispatch(requestData());
return axios({
url: 'http://api.giphy.com/v1/stickers/trending?api_key=NAYLSmLVicJU093K0EsRWC5MY077DgeH&limit=20&ratinng=a',
timeout: 20000,
method: 'get',
responseType: 'json'
})
.then(function(response) {
dispatch(receiveData(response.data));
})
.catch(function(response){
dispatch(receiveError(response.data));
})
}
};
|
window.__imported__ = window.__imported__ || {};
window.__imported__["scratchSketchFile@2x/layers.json.js"] = [
{
"objectId": "6E7094A9-6514-4748-86FF-3948F027429D",
"kind": "artboard",
"name": "HAMBURGER_MENU",
"originalName": "HAMBURGER_MENU",
"maskFrame": null,
"layerFrame": {
"x": -476,
"y": -638,
"width": 375,
"height": 791
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(255, 255, 255, 1)",
"children": [
{
"objectId": "1AF64F71-E6F2-4F11-A56F-0FEFA2487DCD",
"kind": "group",
"name": "menu_list",
"originalName": "menu_list",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 281,
"width": 375,
"height": 512
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "1B2E46F9-CAB0-4C68-8779-B8E50725CEBE",
"kind": "group",
"name": "btn_eatdrinknight",
"originalName": "btn_eatdrinknight*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 281,
"width": 375,
"height": 64
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_eatdrinknight-muiyrtq2.png",
"frame": {
"x": 0,
"y": 281,
"width": 375,
"height": 64
}
},
"children": []
},
{
"objectId": "8E55962B-24B3-4752-9004-F01493813D81",
"kind": "group",
"name": "btn_family",
"originalName": "btn_family",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 345,
"width": 375,
"height": 64
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_family-oeu1ntk2.png",
"frame": {
"x": 0,
"y": 345,
"width": 375,
"height": 64
}
},
"children": []
},
{
"objectId": "7B4505D9-85BB-40A5-8B8D-B60B5F401898",
"kind": "group",
"name": "btn_wellness",
"originalName": "btn_wellness*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 409,
"width": 375,
"height": 64
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_wellness-n0i0nta1.png",
"frame": {
"x": 0,
"y": 409,
"width": 375,
"height": 64
}
},
"children": []
},
{
"objectId": "85BD5865-B58E-44EF-9247-2D6732E451CE",
"kind": "group",
"name": "btn_all_events",
"originalName": "btn_all_events*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 473,
"width": 375,
"height": 64
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_all_events-odvcrdu4.png",
"frame": {
"x": 0,
"y": 473,
"width": 375,
"height": 64
}
},
"children": []
},
{
"objectId": "35ACA6B1-C5F3-469E-8BA4-D3B1ED0F634D",
"kind": "group",
"name": "btn_excursions",
"originalName": "btn_excursions",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 537,
"width": 375,
"height": 64
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_excursions-mzvbq0e2.png",
"frame": {
"x": 0,
"y": 537,
"width": 375,
"height": 64
}
},
"children": []
},
{
"objectId": "C4D40252-3C6A-41B8-A0C1-1C8D0ECC2C77",
"kind": "group",
"name": "btn_meine_termine_menuItem",
"originalName": "btn_meine_termine_menuItem*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 601,
"width": 375,
"height": 64
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_meine_termine_menuItem-qzrenday.png",
"frame": {
"x": 0,
"y": 601,
"width": 375,
"height": 64
}
},
"children": []
},
{
"objectId": "DB91D497-1A2F-402E-891E-C5A5EFFD7CFF",
"kind": "group",
"name": "inactive_events",
"originalName": "inactive_events*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 665,
"width": 375,
"height": 128
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-inactive_events-rei5muq0.png",
"frame": {
"x": 0,
"y": 665,
"width": 375,
"height": 128
}
},
"children": []
}
]
},
{
"objectId": "50E92F98-397A-4F9E-8DCE-891B305171EA",
"kind": "group",
"name": "profile",
"originalName": "profile*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": -1,
"width": 375,
"height": 282
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-profile-ntbfotjg.png",
"frame": {
"x": 0,
"y": -1,
"width": 375,
"height": 282
}
},
"children": []
},
{
"objectId": "157533E5-0335-4424-90C4-C83F6B4A9338",
"kind": "group",
"name": "close_icon",
"originalName": "close_icon*",
"maskFrame": null,
"layerFrame": {
"x": 19,
"y": 42,
"width": 24,
"height": 24
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-close_icon-mtu3ntmz.png",
"frame": {
"x": 19,
"y": 42,
"width": 24,
"height": 24
}
},
"children": []
}
]
},
{
"objectId": "EABCAD10-BB3B-4C04-9F14-C93A6B3540D4",
"kind": "artboard",
"name": "LIST_ENTDECKEN",
"originalName": "LIST_ENTDECKEN",
"maskFrame": null,
"layerFrame": {
"x": 7181,
"y": -622,
"width": 375,
"height": 1844
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(255, 255, 255, 1)",
"children": [
{
"objectId": "2545F0CD-2DAF-463D-BD47-5A268860D496",
"kind": "group",
"name": "btn_list_back",
"originalName": "btn_list_back*",
"maskFrame": null,
"layerFrame": {
"x": 21,
"y": 29,
"width": 15,
"height": 26
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_list_back-mju0nuyw.png",
"frame": {
"x": 21,
"y": 29,
"width": 15,
"height": 26
}
},
"children": []
},
{
"objectId": "293112DB-D0A6-4F96-8E2B-83EE6F58EA53",
"kind": "group",
"name": "list_item_champagne",
"originalName": "list_item_champagne*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 840,
"width": 375,
"height": 168
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-list_item_champagne-mjkzmtey.png",
"frame": {
"x": 0,
"y": 840,
"width": 375,
"height": 168
}
},
"children": []
},
{
"objectId": "7FF6276D-9568-4722-96E2-E6AEFCF3F993",
"kind": "group",
"name": "list_item_cabaret",
"originalName": "list_item_cabaret*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1508,
"width": 375,
"height": 168
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-list_item_cabaret-n0zgnji3.png",
"frame": {
"x": 0,
"y": 1508,
"width": 375,
"height": 168
}
},
"children": []
},
{
"objectId": "79C7295C-944A-4DE0-9714-1D82C487849D",
"kind": "group",
"name": "list_all_inactive",
"originalName": "list_all_inactive*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 1844
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-list_all_inactive-nzldnzi5.png",
"frame": {
"x": 0,
"y": 0,
"width": 375,
"height": 1844
}
},
"children": []
}
]
},
{
"objectId": "CE0CC05A-647D-4142-B275-94F28297A286",
"kind": "artboard",
"name": "DESTINATION_ARTICLE",
"originalName": "DESTINATION ARTICLE",
"maskFrame": null,
"layerFrame": {
"x": 422,
"y": -638,
"width": 375,
"height": 3423
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(255, 255, 255, 1)",
"children": [
{
"objectId": "51568948-ACC9-49DC-87FB-6BD1674AA4E3",
"kind": "group",
"name": "btn_articleClose",
"originalName": "btn_articleClose*",
"maskFrame": null,
"layerFrame": {
"x": 18,
"y": 29,
"width": 26,
"height": 26
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_articleClose-nte1njg5.png",
"frame": {
"x": 18,
"y": 29,
"width": 26,
"height": 26
}
},
"children": []
},
{
"objectId": "B5DAE1FC-B66F-4867-8938-E61F8AEFE85F",
"kind": "group",
"name": "lehavre_content",
"originalName": "lehavre_content*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 480,
"width": 381,
"height": 2837
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-lehavre_content-qjvequux.png",
"frame": {
"x": 0,
"y": 480,
"width": 381,
"height": 2837
}
},
"children": []
},
{
"objectId": "4816428A-4C58-4A1A-A0E7-EB5F2EBDFE8D",
"kind": "group",
"name": "main_image_items",
"originalName": "main_image_items",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 480
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "36777A49-25AF-47D0-A36A-6DD62CB0DAD3",
"kind": "group",
"name": "destination_location",
"originalName": "destination_location*",
"maskFrame": null,
"layerFrame": {
"x": 24,
"y": 78,
"width": 135,
"height": 18
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-destination_location-mzy3nzdb.png",
"frame": {
"x": 24,
"y": 78,
"width": 135,
"height": 18
}
},
"children": []
},
{
"objectId": "1DACDFF0-7F17-4F8D-81BD-3EE8D4AE63F1",
"kind": "group",
"name": "article_headline",
"originalName": "article_headline*",
"maskFrame": null,
"layerFrame": {
"x": 23,
"y": 114,
"width": 246,
"height": 190
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-article_headline-murbq0rg.png",
"frame": {
"x": 23,
"y": 114,
"width": 246,
"height": 190
}
},
"children": []
},
{
"objectId": "564CB32C-3E95-49C2-81FF-DADF2CDC4C50",
"kind": "group",
"name": "destination_beauty_image",
"originalName": "destination_beauty_image*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 480
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-destination_beauty_image-nty0q0iz.png",
"frame": {
"x": 0,
"y": 0,
"width": 375,
"height": 480
}
},
"children": []
}
]
}
]
},
{
"objectId": "29AE0800-C9DC-44A4-90B1-078CA0C11F54",
"kind": "artboard",
"name": "MY_DAY",
"originalName": "MY_DAY",
"maskFrame": null,
"layerFrame": {
"x": -13,
"y": -640,
"width": 375,
"height": 2027
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(255, 255, 255, 1)",
"children": [
{
"objectId": "887B57E1-7236-46DF-9084-5F63883A1E1D",
"kind": "group",
"name": "_status_Bar",
"originalName": "_status_Bar*",
"maskFrame": null,
"layerFrame": {
"x": 6,
"y": 5,
"width": 363,
"height": 14
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-_status_Bar-odg3qju3.png",
"frame": {
"x": 6,
"y": 5,
"width": 363,
"height": 14
}
},
"children": []
},
{
"objectId": "47849EDF-CEBA-4DC7-BC41-6B13A0618991",
"kind": "group",
"name": "_burgerMenu_icon",
"originalName": "_burgerMenu_icon*",
"maskFrame": null,
"layerFrame": {
"x": 1,
"y": 14,
"width": 80,
"height": 80
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-_burgerMenu_icon-ndc4ndlf.png",
"frame": {
"x": 1,
"y": 14,
"width": 80,
"height": 80
}
},
"children": []
},
{
"objectId": "CF912CBD-B16B-440F-B7BD-4F0C7188AC46",
"kind": "group",
"name": "_weather_icon",
"originalName": "_weather_icon*",
"maskFrame": null,
"layerFrame": {
"x": 283,
"y": 35,
"width": 72,
"height": 54
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-_weather_icon-q0y5mtjd.png",
"frame": {
"x": 283,
"y": 35,
"width": 72,
"height": 54
}
},
"children": []
},
{
"objectId": "3C331DDB-8CE2-45E8-9AFC-EC331643F02B",
"kind": "group",
"name": "myDayPanel",
"originalName": "myDayPanel",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 616,
"width": 719,
"height": 1412
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "95A26DDF-4EC2-447C-BF99-6D1720E983A3",
"kind": "group",
"name": "sectionMyDates",
"originalName": "sectionMyDates",
"maskFrame": null,
"layerFrame": {
"x": 18,
"y": 710,
"width": 655,
"height": 218
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "96358A24-CCF0-4696-89EA-CF4650E718B0",
"kind": "group",
"name": "placeholderSwiperMyDates",
"originalName": "placeholderSwiperMyDates*",
"maskFrame": null,
"layerFrame": {
"x": 18,
"y": 745,
"width": 655,
"height": 143
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-placeholderSwiperMyDates-otyznthb.png",
"frame": {
"x": 18,
"y": 745,
"width": 655,
"height": 143
}
},
"children": []
},
{
"objectId": "0BB56DDD-58BE-45AF-A4A5-446CE5CD63F1",
"kind": "group",
"name": "sectionTitle",
"originalName": "sectionTitle*",
"maskFrame": null,
"layerFrame": {
"x": 19,
"y": 710,
"width": 166,
"height": 11
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-sectionTitle-mejcntze.png",
"frame": {
"x": 19,
"y": 710,
"width": 166,
"height": 11
}
},
"children": []
},
{
"objectId": "DF5F1583-D090-49DA-9002-64FAB6A75A26",
"kind": "group",
"name": "triggerShowAllMyDates",
"originalName": "triggerShowAllMyDates*",
"maskFrame": null,
"layerFrame": {
"x": 131,
"y": 913,
"width": 206,
"height": 15
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-triggerShowAllMyDates-rey1rje1.png",
"frame": {
"x": 131,
"y": 913,
"width": 206,
"height": 15
}
},
"children": []
}
]
},
{
"objectId": "60E77E65-6815-42B5-AD58-80031C6C6C4D",
"kind": "group",
"name": "sectionNextEvents",
"originalName": "sectionNextEvents",
"maskFrame": null,
"layerFrame": {
"x": 17,
"y": 1709,
"width": 656,
"height": 274
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "B745D197-DE92-4C87-BAF4-1BE454B30F6F",
"kind": "group",
"name": "sectionTitle1",
"originalName": "sectionTitle*",
"maskFrame": null,
"layerFrame": {
"x": 25,
"y": 1709,
"width": 214,
"height": 14
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-sectionTitle-qjc0nuqx.jpg",
"frame": {
"x": 25,
"y": 1709,
"width": 214,
"height": 14
}
},
"children": []
},
{
"objectId": "02E58CCF-5AC2-4762-A80B-1F7D9F947684",
"kind": "group",
"name": "placeholder_swiperNextEvents",
"originalName": "placeholder_swiperNextEvents*",
"maskFrame": null,
"layerFrame": {
"x": 17,
"y": 1750,
"width": 656,
"height": 193
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-placeholder_swiperNextEvents-mdjfnthd.jpg",
"frame": {
"x": 17,
"y": 1750,
"width": 656,
"height": 193
}
},
"children": []
},
{
"objectId": "C8645AE9-AD77-46E5-BEED-F60CDCE6F8EA",
"kind": "group",
"name": "triggerShowAllEvents",
"originalName": "triggerShowAllEvents*",
"maskFrame": null,
"layerFrame": {
"x": 118,
"y": 1968,
"width": 218,
"height": 15
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-triggerShowAllEvents-qzg2ndvb.png",
"frame": {
"x": 118,
"y": 1968,
"width": 218,
"height": 15
}
},
"children": []
}
]
},
{
"objectId": "65E7BA24-0D29-4915-8944-01E412CC9354",
"kind": "group",
"name": "sectionOpenRestaurants",
"originalName": "sectionOpenRestaurants",
"maskFrame": null,
"layerFrame": {
"x": 1,
"y": 982,
"width": 718,
"height": 272
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "DC8092EC-A00E-4CC2-A140-29C9ADACA93C",
"kind": "text",
"name": "sectionTitle2",
"originalName": "sectionTitle*",
"maskFrame": null,
"layerFrame": {
"x": 27,
"y": 982,
"width": 119,
"height": 14
},
"visible": true,
"metadata": {
"opacity": 1,
"string": "Jetzt geöffnet",
"css": [
"/* Jetzt geöffnet: */",
"font-family: FrutigerLTStd-Bold;",
"font-size: 14px;",
"color: #3399CC;",
"letter-spacing: 0.78px;",
"line-height: 20px;"
]
},
"image": {
"path": "images/Layer-sectionTitle-rem4mdky.png",
"frame": {
"x": 27,
"y": 982,
"width": 119,
"height": 14
}
},
"children": []
},
{
"objectId": "6FDE2EC7-B5F1-4A9D-A745-F05A4A836FC6",
"kind": "group",
"name": "placeholder_swiperOpenRestaurants",
"originalName": "placeholder_swiperOpenRestaurants*",
"maskFrame": null,
"layerFrame": {
"x": 1,
"y": 1019,
"width": 718,
"height": 193
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-placeholder_swiperOpenRestaurants-nkzertjf.jpg",
"frame": {
"x": 1,
"y": 1019,
"width": 718,
"height": 193
}
},
"children": []
},
{
"objectId": "71DD97A8-16E2-4992-AE73-8A9108CF1A10",
"kind": "group",
"name": "triggerShowAllRestaurants",
"originalName": "triggerShowAllRestaurants*",
"maskFrame": null,
"layerFrame": {
"x": 151,
"y": 1239,
"width": 186,
"height": 15
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-triggerShowAllRestaurants-nzferdk3.png",
"frame": {
"x": 151,
"y": 1239,
"width": 186,
"height": 15
}
},
"children": []
}
]
},
{
"objectId": "8A841356-4E7E-49D7-B7C1-25FB14DA0050",
"kind": "group",
"name": "destinationTipps",
"originalName": "destinationTipps*",
"maskFrame": null,
"layerFrame": {
"x": 25,
"y": 1312,
"width": 328,
"height": 347
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-destinationTipps-oee4ndez.png",
"frame": {
"x": 25,
"y": 1312,
"width": 328,
"height": 347
}
},
"children": []
},
{
"objectId": "95A2A753-F220-4280-96EC-BDCF34046BCD",
"kind": "group",
"name": "myDay_background",
"originalName": "myDay_background*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 616,
"width": 375,
"height": 1412
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-myDay_background-otvbmke3.png",
"frame": {
"x": 0,
"y": 616,
"width": 375,
"height": 1412
}
},
"children": []
}
]
},
{
"objectId": "8171BB31-333B-48AF-9BCE-183E4633171C",
"kind": "group",
"name": "itinerary_text",
"originalName": "itinerary_text*",
"maskFrame": null,
"layerFrame": {
"x": 24,
"y": 362,
"width": 294,
"height": 206
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-itinerary_text-ode3mujc.png",
"frame": {
"x": 24,
"y": 362,
"width": 294,
"height": 206
}
},
"children": []
},
{
"objectId": "90031A7C-6040-42D9-BC46-248D00BDCCAE",
"kind": "group",
"name": "coverimage",
"originalName": "coverimage*",
"maskFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
},
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-coverimage-otawmzfb.png",
"frame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
}
},
"children": []
}
]
},
{
"objectId": "EC321DC5-581D-4F1E-B690-3CEE470B1868",
"kind": "artboard",
"name": "BOOKING_FLOW",
"originalName": "BOOKING FLOW",
"maskFrame": null,
"layerFrame": {
"x": 4276,
"y": -640,
"width": 375,
"height": 667
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(243.00000071525574, 243.00000071525574, 243.00000071525574, 1)",
"children": [
{
"objectId": "D70E7D06-7D7B-408F-BE38-422F2E4FBB21",
"kind": "group",
"name": "icn_close_bookingFlow",
"originalName": "icn_close_bookingFlow*",
"maskFrame": null,
"layerFrame": {
"x": 24,
"y": 19,
"width": 26,
"height": 26
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-icn_close_bookingFlow-rdcwrtde.png",
"frame": {
"x": 24,
"y": 19,
"width": 26,
"height": 26
}
},
"children": []
},
{
"objectId": "18E885AF-07C9-4800-8EF5-67830408A52E",
"kind": "group",
"name": "booking_page_03",
"originalName": "booking_page_03",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "2C7FFB78-4E84-4183-94E0-FF46EDAEB19C",
"kind": "group",
"name": "booking_page_03_actions",
"originalName": "booking_page_03_actions",
"maskFrame": null,
"layerFrame": {
"x": 24,
"y": 535,
"width": 329,
"height": 96
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "19D33810-42C1-46DA-A588-EE941868DA38",
"kind": "group",
"name": "btn_booking_close",
"originalName": "btn_booking_close*",
"maskFrame": null,
"layerFrame": {
"x": 24,
"y": 587,
"width": 327,
"height": 44
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_booking_close-mtlemzm4.png",
"frame": {
"x": 24,
"y": 587,
"width": 327,
"height": 44
}
},
"children": []
},
{
"objectId": "8BD1BD45-16D8-4983-B8A1-E3330822E0B4",
"kind": "group",
"name": "btn_booking_view_all_appointments",
"originalName": "btn_booking_view_all_appointments*",
"maskFrame": null,
"layerFrame": {
"x": 25,
"y": 535,
"width": 328,
"height": 44
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_booking_view_all_appointments-oejemuje.png",
"frame": {
"x": 25,
"y": 535,
"width": 328,
"height": 44
}
},
"children": []
}
]
},
{
"objectId": "C916DD31-EC8D-480D-A262-43539657CB0B",
"kind": "group",
"name": "page_contents_03",
"originalName": "page_contents_03*",
"maskFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 224
},
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-page_contents_03-qzkxnkre.png",
"frame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
}
},
"children": []
}
]
},
{
"objectId": "1507DACE-9FC9-491C-A7BA-3D3E88E586F3",
"kind": "group",
"name": "booking_page_02",
"originalName": "booking_page_02",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "B5B46731-CB49-4139-BFCC-77F0E1437C25",
"kind": "group",
"name": "booking_page_02_actions",
"originalName": "booking_page_02_actions",
"maskFrame": null,
"layerFrame": {
"x": 24,
"y": 536,
"width": 328,
"height": 93
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "F2F45618-BF46-48C7-8F66-E8B9DA5A75BC",
"kind": "group",
"name": "btn_continue_02",
"originalName": "btn_continue_02*",
"maskFrame": null,
"layerFrame": {
"x": 24,
"y": 536,
"width": 328,
"height": 44
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_continue_02-rjjgndu2.png",
"frame": {
"x": 24,
"y": 536,
"width": 328,
"height": 44
}
},
"children": []
},
{
"objectId": "98B9E542-7C97-4630-B8D4-76D1ABDE64D6",
"kind": "group",
"name": "btn_back_02",
"originalName": "btn_back_02*",
"maskFrame": null,
"layerFrame": {
"x": 143,
"y": 614,
"width": 89,
"height": 15
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_back_02-othcouu1.png",
"frame": {
"x": 143,
"y": 614,
"width": 89,
"height": 15
}
},
"children": []
}
]
},
{
"objectId": "8D6C577A-1CBE-4E1F-96C9-8F2BB4F2606E",
"kind": "group",
"name": "page_contents_02",
"originalName": "page_contents_02*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-page_contents_02-oeq2qzu3.png",
"frame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
}
},
"children": []
}
]
},
{
"objectId": "AE42D28D-D69D-484C-8FB4-C71A46FAB6ED",
"kind": "group",
"name": "booking_page_01",
"originalName": "booking_page_01",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "470D3899-CBBF-4AD9-8D4B-B36426421773",
"kind": "group",
"name": "btn_continue_01",
"originalName": "btn_continue_01*",
"maskFrame": null,
"layerFrame": {
"x": 25,
"y": 536,
"width": 325,
"height": 44
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_continue_01-ndcwrdm4.png",
"frame": {
"x": 25,
"y": 536,
"width": 325,
"height": 44
}
},
"children": []
},
{
"objectId": "96A0818B-CF4D-4282-A6B5-A4AEB0F8E078",
"kind": "group",
"name": "page_contents_01",
"originalName": "page_contents_01*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-page_contents_01-otzbmdgx.png",
"frame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
}
},
"children": []
}
]
}
]
},
{
"objectId": "5274B7AD-6B94-472C-AF14-75E376EF349F",
"kind": "artboard",
"name": "MYDAY_EVENTS_PAGES",
"originalName": "MYDAY_EVENTS_PAGES",
"maskFrame": null,
"layerFrame": {
"x": -1559,
"y": 1717,
"width": 320,
"height": 193
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(255, 255, 255, 1)",
"children": [
{
"objectId": "2C5FE10C-9250-448D-B052-B847F1CE11A2",
"kind": "group",
"name": "event_pg_01",
"originalName": "event_pg_01*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 320,
"height": 193
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-event_pg_01-mkm1rkux.png",
"frame": {
"x": 0,
"y": 0,
"width": 320,
"height": 193
}
},
"children": []
},
{
"objectId": "03810B3C-171E-459B-9918-506BAE871BD4",
"kind": "group",
"name": "event_pg_02",
"originalName": "event_pg_02*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 320,
"height": 193
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-event_pg_02-mdm4mtbc.png",
"frame": {
"x": 0,
"y": 0,
"width": 320,
"height": 193
}
},
"children": []
},
{
"objectId": "3DE54C9C-656E-41DC-A7AE-72C8F6115D1A",
"kind": "group",
"name": "event_pg_03",
"originalName": "event_pg_03*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 320,
"height": 193
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-event_pg_03-m0rfntrd.png",
"frame": {
"x": 0,
"y": 0,
"width": 320,
"height": 193
}
},
"children": []
},
{
"objectId": "379623F3-1B83-4454-8DEF-0FCCC094AA1B",
"kind": "group",
"name": "event_pg_04",
"originalName": "event_pg_04*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 320,
"height": 193
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-event_pg_04-mzc5njiz.png",
"frame": {
"x": 0,
"y": 0,
"width": 320,
"height": 193
}
},
"children": []
},
{
"objectId": "8C848EA5-D0E5-4F3C-A594-0D85D96AA782",
"kind": "group",
"name": "event_pg_05",
"originalName": "event_pg_05*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 320,
"height": 193
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-event_pg_05-oem4ndhf.png",
"frame": {
"x": 0,
"y": 0,
"width": 320,
"height": 193
}
},
"children": []
}
]
},
{
"objectId": "E9C1E8B7-7053-4578-9040-85E7E79B541D",
"kind": "artboard",
"name": "EVENTS",
"originalName": "EVENTS",
"maskFrame": null,
"layerFrame": {
"x": 892,
"y": -638,
"width": 375,
"height": 1438
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(255, 255, 255, 1)",
"children": [
{
"objectId": "78E59B20-1302-4926-B8D3-CEE089E1CE09",
"kind": "group",
"name": "btn_eventsClose",
"originalName": "btn_eventsClose*",
"maskFrame": null,
"layerFrame": {
"x": 18,
"y": 29,
"width": 26,
"height": 26
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_eventsClose-nzhfntlc.png",
"frame": {
"x": 18,
"y": 29,
"width": 26,
"height": 26
}
},
"children": []
},
{
"objectId": "F0CE3834-9E1B-4CC9-8571-F959B2D80C3F",
"kind": "group",
"name": "events_heading",
"originalName": "events_heading*",
"maskFrame": null,
"layerFrame": {
"x": 24,
"y": 293,
"width": 320,
"height": 52
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-events_heading-rjbdrtm4.png",
"frame": {
"x": 24,
"y": 293,
"width": 320,
"height": 52
}
},
"children": []
},
{
"objectId": "27C9FDF1-9CB7-40FE-A7A6-43D6E807414A",
"kind": "group",
"name": "keyImage",
"originalName": "keyImage*",
"maskFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 375
},
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 375
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-keyImage-mjddouze.png",
"frame": {
"x": 0,
"y": 0,
"width": 375,
"height": 375
}
},
"children": []
},
{
"objectId": "834238C3-EDA2-43E7-BD06-E781D8065BE7",
"kind": "group",
"name": "category_contents",
"originalName": "category_contents",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 377,
"width": 375,
"height": 1066
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-category_contents-odm0mjm4.png",
"frame": {
"x": 0,
"y": 377,
"width": 375,
"height": 1066
}
},
"children": [
{
"objectId": "1E79E5EC-D04A-413A-9F74-A2486FB7A662",
"kind": "text",
"name": "btn_show_alleTermine",
"originalName": "btn_show_alleTermine*",
"maskFrame": null,
"layerFrame": {
"x": 143,
"y": 651,
"width": 193,
"height": 15
},
"visible": true,
"metadata": {
"opacity": 1,
"string": "Alle meine Termine anzeigen",
"css": [
"/* Alle meine Termine a: */",
"font-family: FrutigerLTStd-Roman;",
"font-size: 14px;",
"color: #3399CC;",
"letter-spacing: 0.1px;"
]
},
"image": {
"path": "images/Layer-btn_show_alleTermine-muu3ouu1.png",
"frame": {
"x": 143,
"y": 651,
"width": 193,
"height": 15
}
},
"children": []
},
{
"objectId": "E1E7AD50-7D5D-45A4-8C5E-75FA2815E0C8",
"kind": "group",
"name": "sectionMyDates1",
"originalName": "sectionMyDates*",
"maskFrame": {
"x": 0,
"y": 0.7345473732212895,
"width": 375,
"height": 249.99999999999997
},
"layerFrame": {
"x": 0,
"y": 431.7345473732213,
"width": 375,
"height": 249.99999999999997
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-sectionMyDates-rtffn0fe.png",
"frame": {
"x": 0,
"y": 431.7345473732213,
"width": 375,
"height": 249.99999999999997
}
},
"children": []
},
{
"objectId": "D0EACDBC-BA9B-4A5B-8B82-7E54BB543F57",
"kind": "group",
"name": "categoryEntdecken",
"originalName": "categoryEntdecken*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 969,
"width": 375,
"height": 118
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-categoryEntdecken-rdbfqune.png",
"frame": {
"x": 0,
"y": 969,
"width": 375,
"height": 118
}
},
"children": []
},
{
"objectId": "A2CEE1E3-FBA6-4296-A42B-A641C1FA7169",
"kind": "group",
"name": "categoryAlle",
"originalName": "categoryAlle*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 736,
"width": 375,
"height": 118
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-categoryAlle-qtjdruux.png",
"frame": {
"x": 0,
"y": 736,
"width": 375,
"height": 118
}
},
"children": []
},
{
"objectId": "FA059266-CC6F-4625-98B1-27C180DE2F39",
"kind": "group",
"name": "inactcive_Categories",
"originalName": "inactcive_Categories*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 854,
"width": 375,
"height": 585
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-inactcive_Categories-rkewntky.png",
"frame": {
"x": 0,
"y": 854,
"width": 375,
"height": 585
}
},
"children": []
}
]
}
]
},
{
"objectId": "B4E864CE-D1A3-4BC1-B238-56D11C5BBD0D",
"kind": "artboard",
"name": "TOPICS_EATDRINKNIGHT",
"originalName": "TOPICS_EATDRINKNIGHT",
"maskFrame": null,
"layerFrame": {
"x": 3048,
"y": 4173,
"width": 375,
"height": 1246
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(243, 243, 243, 1)",
"children": [
{
"objectId": "2A6EE9D8-684D-4B67-8E60-0040B17366C0",
"kind": "group",
"name": "btn_eatdrinknightClose",
"originalName": "btn_eatdrinknightClose*",
"maskFrame": null,
"layerFrame": {
"x": 18,
"y": 29,
"width": 26,
"height": 26
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_eatdrinknightClose-mke2ruu5.png",
"frame": {
"x": 18,
"y": 29,
"width": 26,
"height": 26
}
},
"children": []
},
{
"objectId": "EDAABA4B-F3C8-4D43-8559-2A049BD554E7",
"kind": "group",
"name": "topEatdrinknight_heading",
"originalName": "topEatdrinknight_heading*",
"maskFrame": null,
"layerFrame": {
"x": 25,
"y": 301,
"width": 336,
"height": 101
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-topEatdrinknight_heading-rurbqujb.png",
"frame": {
"x": 25,
"y": 301,
"width": 336,
"height": 101
}
},
"children": []
},
{
"objectId": "02EE6908-84A7-489D-BB7F-6F9F98E1CA48",
"kind": "group",
"name": "topEatdrinknight_keyImage",
"originalName": "topEatdrinknight_keyImage*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 422
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-topEatdrinknight_keyImage-mdjfrty5.jpg",
"frame": {
"x": 0,
"y": 0,
"width": 375,
"height": 422
}
},
"children": []
},
{
"objectId": "A7C797D7-12A5-4B2B-A508-06C214C29F92",
"kind": "group",
"name": "topEatdrinknight_category_contents",
"originalName": "topEatdrinknight_category_contents",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 421,
"width": 375,
"height": 743
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "78B160FB-A7CF-4D4E-ACE5-D558CB0BC5DD",
"kind": "group",
"name": "promotion",
"originalName": "promotion*",
"maskFrame": null,
"layerFrame": {
"x": 24,
"y": 487,
"width": 329,
"height": 242
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-promotion-nzhcmtyw.png",
"frame": {
"x": 24,
"y": 487,
"width": 329,
"height": 242
}
},
"children": []
},
{
"objectId": "E62E724A-AF4C-45F1-B7D4-44860BD3A890",
"kind": "group",
"name": "btn_TEDN_all",
"originalName": "btn_TEDN_all*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 800,
"width": 375,
"height": 91
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TEDN_all-rtyyrtcy.png",
"frame": {
"x": 0,
"y": 800,
"width": 375,
"height": 91
}
},
"children": []
},
{
"objectId": "E42CE4DA-28E0-4CDF-9765-EB7EA7A3CA13",
"kind": "group",
"name": "btn_TEDN_restaurants",
"originalName": "btn_TEDN_restaurants*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 916,
"width": 375,
"height": 66
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TEDN_restaurants-rtqyq0u0.png",
"frame": {
"x": 0,
"y": 916,
"width": 375,
"height": 66
}
},
"children": []
},
{
"objectId": "8E20D44D-8F08-4392-85F5-B524BF509B13",
"kind": "group",
"name": "btn_TEDN_cafes",
"originalName": "btn_TEDN_cafes*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1003,
"width": 375,
"height": 70
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TEDN_cafes-oeuymeq0.png",
"frame": {
"x": 0,
"y": 1003,
"width": 375,
"height": 70
}
},
"children": []
},
{
"objectId": "075AC75E-ACA1-4786-8133-3ED693B8D04B",
"kind": "group",
"name": "btn_TEDN_bars",
"originalName": "btn_TEDN_bars*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1098,
"width": 375,
"height": 66
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TEDN_bars-mdc1qum3.png",
"frame": {
"x": 0,
"y": 1098,
"width": 375,
"height": 66
}
},
"children": []
},
{
"objectId": "A04C3B04-E76F-4204-BB78-871E19F08796",
"kind": "group",
"name": "background",
"originalName": "background*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 421,
"width": 375,
"height": 742
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-background-qta0qznc.png",
"frame": {
"x": 0,
"y": 421,
"width": 375,
"height": 742
}
},
"children": []
}
]
}
]
},
{
"objectId": "002A408A-4F23-401C-860B-61EEAB848E3A",
"kind": "artboard",
"name": "TOPICS_EXCURSIONS",
"originalName": "TOPICS_EXCURSIONS",
"maskFrame": null,
"layerFrame": {
"x": 2520,
"y": 4173,
"width": 375,
"height": 1438
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(243, 243, 243, 1)",
"children": [
{
"objectId": "D8D1BFE2-A3FF-4DD1-9E5E-BF2494AEA5B3",
"kind": "group",
"name": "btn_topExcursionsClose",
"originalName": "btn_topExcursionsClose*",
"maskFrame": null,
"layerFrame": {
"x": 18,
"y": 29,
"width": 26,
"height": 26
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_topExcursionsClose-rdhemujg.png",
"frame": {
"x": 18,
"y": 29,
"width": 26,
"height": 26
}
},
"children": []
},
{
"objectId": "5FBAB343-43CE-4D17-AD71-E12287375594",
"kind": "group",
"name": "topExcursions_heading",
"originalName": "topExcursions_heading*",
"maskFrame": null,
"layerFrame": {
"x": 24,
"y": 331,
"width": 200,
"height": 66
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-topExcursions_heading-nuzcquiz.png",
"frame": {
"x": 24,
"y": 331,
"width": 200,
"height": 66
}
},
"children": []
},
{
"objectId": "11242E47-A812-474F-80CF-AB729DC53ADA",
"kind": "group",
"name": "topExcursions_keyImage",
"originalName": "topExcursions_keyImage*",
"maskFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 422
},
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 422
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-topExcursions_keyImage-mteyndjf.png",
"frame": {
"x": 0,
"y": 0,
"width": 375,
"height": 422
}
},
"children": []
},
{
"objectId": "3CFB1DEE-4D1A-4B6A-8217-88B6312B5506",
"kind": "group",
"name": "topExcursions_category_contents",
"originalName": "topExcursions_category_contents",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 422,
"width": 375,
"height": 924
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "C2267159-5CB8-4D4B-A461-90673C3C060B",
"kind": "group",
"name": "promotion1",
"originalName": "promotion*",
"maskFrame": null,
"layerFrame": {
"x": 24,
"y": 487,
"width": 329,
"height": 242
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-promotion-qziynjcx.png",
"frame": {
"x": 24,
"y": 487,
"width": 329,
"height": 242
}
},
"children": []
},
{
"objectId": "F5505C6A-D91B-4876-8C79-056902DD5065",
"kind": "group",
"name": "btn_TEx_all",
"originalName": "btn_TEx_all*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 800,
"width": 375,
"height": 91
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TEx_all-rju1mdvd.png",
"frame": {
"x": 0,
"y": 800,
"width": 375,
"height": 91
}
},
"children": []
},
{
"objectId": "3AEFD7D1-B446-47D9-9A14-2AF74892C9F9",
"kind": "group",
"name": "btn_TEx_family",
"originalName": "btn_TEx_family*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 916,
"width": 375,
"height": 66
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TEx_family-m0ffrkq3.png",
"frame": {
"x": 0,
"y": 916,
"width": 375,
"height": 66
}
},
"children": []
},
{
"objectId": "F1DF676C-C015-4BAE-BD79-3A8EE6122B54",
"kind": "group",
"name": "btn_TEx_aktiv",
"originalName": "btn_TEx_aktiv*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1007,
"width": 375,
"height": 66
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TEx_aktiv-rjferjy3.png",
"frame": {
"x": 0,
"y": 1007,
"width": 375,
"height": 66
}
},
"children": []
},
{
"objectId": "42E91987-A466-4390-BB6D-A9244B19F9FF",
"kind": "group",
"name": "btn_TEx_landschaft",
"originalName": "btn_TEx_landschaft*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1098,
"width": 375,
"height": 66
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TEx_landschaft-ndjfote5.png",
"frame": {
"x": 0,
"y": 1098,
"width": 375,
"height": 66
}
},
"children": []
},
{
"objectId": "5526DF1E-FAE5-4E98-B493-0F58E353A52B",
"kind": "group",
"name": "btn_TEx_cities",
"originalName": "btn_TEx_cities*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1185,
"width": 375,
"height": 71
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TEx_cities-ntuynkrg.png",
"frame": {
"x": 0,
"y": 1185,
"width": 375,
"height": 71
}
},
"children": []
},
{
"objectId": "146286AA-09F4-4527-A537-D678BC9704D2",
"kind": "group",
"name": "btn_TEx_sun",
"originalName": "btn_TEx_sun*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1281,
"width": 375,
"height": 65
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TEx_sun-mtq2mjg2.png",
"frame": {
"x": 0,
"y": 1281,
"width": 375,
"height": 65
}
},
"children": []
},
{
"objectId": "497CB430-FF4D-47EC-B0B4-7BAC9C48DCC2",
"kind": "group",
"name": "background1",
"originalName": "background*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 422,
"width": 375,
"height": 924
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-background-ndk3q0i0.png",
"frame": {
"x": 0,
"y": 422,
"width": 375,
"height": 924
}
},
"children": []
}
]
}
]
},
{
"objectId": "29A3F3C9-AEDD-45D6-A088-74D7E0DED0C3",
"kind": "artboard",
"name": "TOPICS_EVENTS",
"originalName": "TOPICS_EVENTS",
"maskFrame": null,
"layerFrame": {
"x": 1951,
"y": 4173,
"width": 375,
"height": 1438
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(243, 243, 243, 1)",
"children": [
{
"objectId": "AB329595-BB30-4BDD-89C6-3E9B0E7FF191",
"kind": "group",
"name": "btn_topEventsClose",
"originalName": "btn_topEventsClose*",
"maskFrame": null,
"layerFrame": {
"x": 18,
"y": 29,
"width": 26,
"height": 26
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_topEventsClose-quizmjk1.png",
"frame": {
"x": 18,
"y": 29,
"width": 26,
"height": 26
}
},
"children": []
},
{
"objectId": "8A746308-053E-4943-87DC-68C26D06B6F0",
"kind": "group",
"name": "topEvents_heading",
"originalName": "topEvents_heading*",
"maskFrame": null,
"layerFrame": {
"x": 24,
"y": 336,
"width": 321,
"height": 62
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-topEvents_heading-oee3ndyz.png",
"frame": {
"x": 24,
"y": 336,
"width": 321,
"height": 62
}
},
"children": []
},
{
"objectId": "DF51D32C-A9F7-4DAD-96A9-CA3EA70C9AAF",
"kind": "group",
"name": "topEvents_keyImage",
"originalName": "topEvents_keyImage*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 422
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-topEvents_keyImage-rey1muqz.png",
"frame": {
"x": 0,
"y": 0,
"width": 375,
"height": 422
}
},
"children": []
},
{
"objectId": "0466EBBB-6A0B-4E33-8E95-AA0BEFDCC272",
"kind": "group",
"name": "topEvents_category_contents",
"originalName": "topEvents_category_contents",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 422,
"width": 375,
"height": 926
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "70561014-F43C-4D2A-A83C-6783477B4D22",
"kind": "group",
"name": "promotion2",
"originalName": "promotion*",
"maskFrame": null,
"layerFrame": {
"x": 24,
"y": 487,
"width": 329,
"height": 242
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-promotion-nza1njew.png",
"frame": {
"x": 24,
"y": 487,
"width": 329,
"height": 242
}
},
"children": []
},
{
"objectId": "18424B63-EB32-443A-AF2E-549FC51CC7BC",
"kind": "group",
"name": "btn_TE_all",
"originalName": "btn_TE_all*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 800,
"width": 375,
"height": 91
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TE_all-mtg0mjrc.png",
"frame": {
"x": 0,
"y": 800,
"width": 375,
"height": 91
}
},
"children": []
},
{
"objectId": "046611DB-8511-4218-87E0-F26142D6F31B",
"kind": "group",
"name": "btn_TE_family",
"originalName": "btn_TE_family*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 917,
"width": 375,
"height": 65
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TE_family-mdq2njex.png",
"frame": {
"x": 0,
"y": 917,
"width": 375,
"height": 65
}
},
"children": []
},
{
"objectId": "301DEDC6-3B6A-4C05-88BF-E718CB7A980A",
"kind": "group",
"name": "btn_TE_sport",
"originalName": "btn_TE_sport*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1007,
"width": 375,
"height": 66
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TE_sport-mzaxreve.png",
"frame": {
"x": 0,
"y": 1007,
"width": 375,
"height": 66
}
},
"children": []
},
{
"objectId": "F799B79E-6A44-4AD8-8199-8B8FA6F229AF",
"kind": "group",
"name": "btn_TE_geniesen",
"originalName": "btn_TE_geniesen*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1189,
"width": 375,
"height": 67
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TE_geniesen-rjc5oui3.png",
"frame": {
"x": 0,
"y": 1189,
"width": 375,
"height": 67
}
},
"children": []
},
{
"objectId": "6AE5C2F1-3A73-448E-8380-CAE92F0F40A1",
"kind": "group",
"name": "btn_TE_enjoy",
"originalName": "btn_TE_enjoy*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1098,
"width": 375,
"height": 66
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TE_enjoy-nkffnumy.png",
"frame": {
"x": 0,
"y": 1098,
"width": 375,
"height": 66
}
},
"children": []
},
{
"objectId": "9DC7AB5C-D8C3-4C76-A74C-CA47BA3B2550",
"kind": "group",
"name": "btn_TE_discover",
"originalName": "btn_TE_discover*",
"maskFrame": null,
"layerFrame": {
"x": 24,
"y": 1280,
"width": 337,
"height": 47
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TE_discover-ourdn0fc.png",
"frame": {
"x": 24,
"y": 1280,
"width": 337,
"height": 47
}
},
"children": []
},
{
"objectId": "25EE2DE3-DC2A-4006-81BD-5838EC59AC0F",
"kind": "group",
"name": "background2",
"originalName": "background*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 422,
"width": 375,
"height": 926
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-background-mjvfrtje.png",
"frame": {
"x": 0,
"y": 422,
"width": 375,
"height": 926
}
},
"children": []
}
]
}
]
},
{
"objectId": "625F539A-BD14-4BC2-94CB-546EF0CD57CE",
"kind": "artboard",
"name": "TOPICS_WELLNESS",
"originalName": "TOPICS_WELLNESS",
"maskFrame": null,
"layerFrame": {
"x": 1382,
"y": 4173,
"width": 375,
"height": 1438
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(243, 243, 243, 1)",
"children": [
{
"objectId": "8BF82633-4EE2-44A7-8374-472717CF1C46",
"kind": "group",
"name": "btn_topWellnessClose",
"originalName": "btn_topWellnessClose*",
"maskFrame": null,
"layerFrame": {
"x": 18,
"y": 29,
"width": 26,
"height": 26
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_topWellnessClose-oejgodi2.png",
"frame": {
"x": 18,
"y": 29,
"width": 26,
"height": 26
}
},
"children": []
},
{
"objectId": "3A817A4F-7A63-41BE-B305-D6C98818B4F3",
"kind": "group",
"name": "topWellness_heading",
"originalName": "topWellness_heading*",
"maskFrame": null,
"layerFrame": {
"x": 24,
"y": 301,
"width": 295,
"height": 96
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-topWellness_heading-m0e4mtdb.png",
"frame": {
"x": 24,
"y": 301,
"width": 295,
"height": 96
}
},
"children": []
},
{
"objectId": "DAF230FA-74C1-44AB-BF9C-AE36944D0B2E",
"kind": "group",
"name": "topWellness_keyImage",
"originalName": "topWellness_keyImage*",
"maskFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 422
},
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 422
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-topWellness_keyImage-refgmjmw.png",
"frame": {
"x": 0,
"y": 0,
"width": 375,
"height": 422
}
},
"children": []
},
{
"objectId": "7CA02D56-C7B0-4D8E-85E2-79E6B0EB8224",
"kind": "group",
"name": "topWellness_category_contents",
"originalName": "topWellness_category_contents",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 422,
"width": 375,
"height": 833
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "81E0B843-070E-4526-8B4E-6966DD9D9C35",
"kind": "group",
"name": "promotion3",
"originalName": "promotion*",
"maskFrame": null,
"layerFrame": {
"x": 24,
"y": 487,
"width": 329,
"height": 242
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-promotion-odffmei4.png",
"frame": {
"x": 24,
"y": 487,
"width": 329,
"height": 242
}
},
"children": []
},
{
"objectId": "E7A3D5B5-38CD-4B77-AB9C-D0CE153C8844",
"kind": "group",
"name": "btn_TW_all",
"originalName": "btn_TW_all*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 800,
"width": 375,
"height": 91
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TW_all-rtdbm0q1.png",
"frame": {
"x": 0,
"y": 800,
"width": 375,
"height": 91
}
},
"children": []
},
{
"objectId": "0967EEF5-692D-443E-BEC8-85769EEF8888",
"kind": "group",
"name": "btn_TW_spa",
"originalName": "btn_TW_spa*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 916,
"width": 375,
"height": 66
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TW_spa-mdk2n0vf.png",
"frame": {
"x": 0,
"y": 916,
"width": 375,
"height": 66
}
},
"children": []
},
{
"objectId": "59976531-BC30-4986-9989-B83D5B0BD2EB",
"kind": "group",
"name": "btn_TW_treatments",
"originalName": "btn_TW_treatments*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1007,
"width": 375,
"height": 66
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TW_treatments-ntk5nzy1.png",
"frame": {
"x": 0,
"y": 1007,
"width": 375,
"height": 66
}
},
"children": []
},
{
"objectId": "B88D10A8-13A7-4BE2-B26D-E7558E89F792",
"kind": "group",
"name": "btn_TW_beauty",
"originalName": "btn_TW_beauty*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1099,
"width": 375,
"height": 65
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TW_beauty-qjg4rdew.png",
"frame": {
"x": 0,
"y": 1099,
"width": 375,
"height": 65
}
},
"children": []
},
{
"objectId": "52185AB5-3C65-466C-949C-C908B51A09FC",
"kind": "group",
"name": "btn_TW_sport",
"originalName": "btn_TW_sport*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1189,
"width": 375,
"height": 66
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_TW_sport-ntixodvb.png",
"frame": {
"x": 0,
"y": 1189,
"width": 375,
"height": 66
}
},
"children": []
},
{
"objectId": "39E084F4-A531-44DF-BF97-322F8093F049",
"kind": "group",
"name": "background3",
"originalName": "background*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 422,
"width": 375,
"height": 833
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-background-mzlfmdg0.png",
"frame": {
"x": 0,
"y": 422,
"width": 375,
"height": 833
}
},
"children": []
}
]
}
]
},
{
"objectId": "E94FB8B6-0BBD-48FE-9A26-EB4E7F45C76D",
"kind": "artboard",
"name": "CHAMPAGNER_DETAIL",
"originalName": "CHAMPAGNER_DETAIL",
"maskFrame": null,
"layerFrame": {
"x": 2953,
"y": -640,
"width": 375,
"height": 3353
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(255, 255, 255, 1)",
"children": [
{
"objectId": "773BE53B-260D-4EAC-AE9C-9CC4334F6144",
"kind": "group",
"name": "champ_likeButton",
"originalName": "champ_likeButton",
"maskFrame": null,
"layerFrame": {
"x": 318,
"y": 31,
"width": 36,
"height": 30
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "1625420A-6C1E-4911-9EAF-852150E7E232",
"kind": "group",
"name": "champ_btn_like_selected",
"originalName": "champ_btn_like_selected*",
"maskFrame": null,
"layerFrame": {
"x": 318,
"y": 31,
"width": 36,
"height": 30
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-champ_btn_like_selected-mtyyntqy.png",
"frame": {
"x": 318,
"y": 31,
"width": 36,
"height": 30
}
},
"children": []
},
{
"objectId": "083E53C4-2CE0-4A46-BF8A-2D63EC199EE0",
"kind": "group",
"name": "champ_btn_like_out",
"originalName": "champ_btn_like_out*",
"maskFrame": null,
"layerFrame": {
"x": 316,
"y": 26,
"width": 40,
"height": 40
},
"visible": false,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-champ_btn_like_out-mdgzrtuz.png",
"frame": {
"x": 316,
"y": 26,
"width": 40,
"height": 40
}
},
"children": []
}
]
},
{
"objectId": "2B58A0BB-4F88-4707-ACA7-E08FDA0F0A47",
"kind": "group",
"name": "btn_cham_detail_close",
"originalName": "btn_cham_detail_close*",
"maskFrame": null,
"layerFrame": {
"x": 11,
"y": 22,
"width": 40,
"height": 40
},
"visible": false,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_cham_detail_close-mki1oeew.png",
"frame": {
"x": 11,
"y": 22,
"width": 40,
"height": 40
}
},
"children": []
},
{
"objectId": "621B9E87-068B-42C6-BD3F-13E253029735",
"kind": "group",
"name": "btn_cham_detail_back",
"originalName": "btn_cham_detail_back*",
"maskFrame": null,
"layerFrame": {
"x": 21,
"y": 29,
"width": 15,
"height": 26
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_cham_detail_back-njixqjlf.png",
"frame": {
"x": 21,
"y": 29,
"width": 15,
"height": 26
}
},
"children": []
},
{
"objectId": "8D13A6FD-85A7-4D50-922A-9F3FFD06166C",
"kind": "group",
"name": "btn_bookNow",
"originalName": "btn_bookNow*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 607,
"width": 375,
"height": 60
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_bookNow-oeqxm0e2.png",
"frame": {
"x": 0,
"y": 607,
"width": 375,
"height": 60
}
},
"children": []
},
{
"objectId": "3BC21F87-8069-4A10-B338-591CECADDD63",
"kind": "group",
"name": "champagner_scroll_contents",
"originalName": "champagner_scroll_contents",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 425,
"width": 376,
"height": 2927
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "C75A8F84-D61F-4E89-ABB4-8EDF1DD3F206",
"kind": "group",
"name": "champagne_info",
"originalName": "champagne_info*",
"maskFrame": null,
"layerFrame": {
"x": 23,
"y": 425,
"width": 329,
"height": 169
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-champagne_info-qzc1qthg.png",
"frame": {
"x": 23,
"y": 425,
"width": 329,
"height": 169
}
},
"children": []
},
{
"objectId": "D60AAD83-E2F1-4D40-8ABA-8E07C3D8B677",
"kind": "group",
"name": "champagne_content",
"originalName": "champagne_content*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 667,
"width": 376,
"height": 2685
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-champagne_content-rdywqufe.png",
"frame": {
"x": 0,
"y": 667,
"width": 376,
"height": 2685
}
},
"children": []
}
]
},
{
"objectId": "5EBF0E49-E07A-436F-AA8A-1C294C72B717",
"kind": "group",
"name": "champagne_background_image",
"originalName": "champagne_background_image*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-champagne_background_image-nuvcrjbf.png",
"frame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
}
},
"children": []
}
]
},
{
"objectId": "4E2FBC41-BFFC-49B5-9DA9-13B5EFB38AF5",
"kind": "artboard",
"name": "CABARET_DETAIL",
"originalName": "CABARET_DETAIL",
"maskFrame": null,
"layerFrame": {
"x": 2391,
"y": -640,
"width": 375,
"height": 3509
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(255, 255, 255, 1)",
"children": [
{
"objectId": "46F19287-0A6C-41CE-A038-4A0DEF6EB9D2",
"kind": "group",
"name": "btn_cabaret_detail_close",
"originalName": "btn_cabaret_detail_close*",
"maskFrame": null,
"layerFrame": {
"x": 11,
"y": 22,
"width": 40,
"height": 40
},
"visible": false,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_cabaret_detail_close-ndzgmtky.png",
"frame": {
"x": 11,
"y": 22,
"width": 40,
"height": 40
}
},
"children": []
},
{
"objectId": "E85F5CA3-CB6C-405F-867D-5D75B7769829",
"kind": "group",
"name": "cabaret_likeButton",
"originalName": "cabaret_likeButton",
"maskFrame": null,
"layerFrame": {
"x": 318,
"y": 31,
"width": 36,
"height": 30
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "F3481EB3-F1B8-4601-BB7C-75AF543ED2E4",
"kind": "group",
"name": "cabaret_btn_like_selected",
"originalName": "cabaret_btn_like_selected*",
"maskFrame": null,
"layerFrame": {
"x": 318,
"y": 31,
"width": 36,
"height": 30
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-cabaret_btn_like_selected-rjm0odff.png",
"frame": {
"x": 318,
"y": 31,
"width": 36,
"height": 30
}
},
"children": []
},
{
"objectId": "6ADCC9E4-CD90-41A3-A07D-70C2D2735406",
"kind": "group",
"name": "cabaret_btn_like_out",
"originalName": "cabaret_btn_like_out*",
"maskFrame": null,
"layerFrame": {
"x": 316,
"y": 26,
"width": 40,
"height": 40
},
"visible": false,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-cabaret_btn_like_out-nkfeq0m5.png",
"frame": {
"x": 316,
"y": 26,
"width": 40,
"height": 40
}
},
"children": []
}
]
},
{
"objectId": "ADCB2F3D-1D86-4898-86B3-044CF72B6D76",
"kind": "group",
"name": "btn_cabaret_detail_back",
"originalName": "btn_cabaret_detail_back*",
"maskFrame": null,
"layerFrame": {
"x": 21,
"y": 29,
"width": 15,
"height": 26
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_cabaret_detail_back-qurdqjjg.png",
"frame": {
"x": 21,
"y": 29,
"width": 15,
"height": 26
}
},
"children": []
},
{
"objectId": "364CA705-1D6C-4EFB-A214-2224F871029A",
"kind": "group",
"name": "cabaret_ScrollContents",
"originalName": "cabaret_ScrollContents",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 491,
"width": 377,
"height": 3020
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "1B740A41-6A36-4102-BB92-D88CCAB13E06",
"kind": "group",
"name": "cabaret_info",
"originalName": "cabaret_info*",
"maskFrame": null,
"layerFrame": {
"x": 23,
"y": 491,
"width": 320,
"height": 132
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-cabaret_info-mui3ndbb.png",
"frame": {
"x": 23,
"y": 491,
"width": 320,
"height": 132
}
},
"children": []
},
{
"objectId": "2642A16B-B8FD-4979-93AB-E86D175264D9",
"kind": "group",
"name": "cabaret_content",
"originalName": "cabaret_content*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 667,
"width": 377,
"height": 2844
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-cabaret_content-mjy0mkex.png",
"frame": {
"x": 0,
"y": 667,
"width": 377,
"height": 2844
}
},
"children": []
}
]
},
{
"objectId": "D17E571B-102E-44F3-BEAF-8D50EA18EDC6",
"kind": "group",
"name": "cabaret_background_Image",
"originalName": "cabaret_background_Image*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-cabaret_background_Image-rde3rtu3.jpg",
"frame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
}
},
"children": []
}
]
},
{
"objectId": "2ACBE6B5-6707-4DA7-BA54-7ED3FBDB911C",
"kind": "artboard",
"name": "_CABARET_DETAIL_Copy",
"originalName": "-CABARET_DETAIL Copy",
"maskFrame": null,
"layerFrame": {
"x": 3500,
"y": -640,
"width": 375,
"height": 3509
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(255, 255, 255, 1)",
"image": {
"path": "images/Layer-_CABARET_DETAIL_Copy-mkfdqku2.png",
"frame": {
"x": 3500,
"y": -640,
"width": 375,
"height": 3509
}
},
"children": [
{
"objectId": "3D1FB563-D05A-4C16-A2DB-26127271DE44",
"kind": "group",
"name": "btn_gemerkt",
"originalName": "btn_gemerkt*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 607,
"width": 375,
"height": 60
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_gemerkt-m0qxrki1.png",
"frame": {
"x": 0,
"y": 607,
"width": 375,
"height": 60
}
},
"children": []
},
{
"objectId": "2B62A7EC-CBC3-4A8C-9CCB-32831428A99E",
"kind": "group",
"name": "btn_merken",
"originalName": "btn_merken*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 607,
"width": 375,
"height": 60
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_merken-mki2mke3.png",
"frame": {
"x": 0,
"y": 607,
"width": 375,
"height": 60
}
},
"children": []
},
{
"objectId": "7E458368-D945-48F1-873D-2D4AC29A7FF1",
"kind": "group",
"name": "btn_cabaret_detail_close1",
"originalName": "btn_cabaret_detail_close*",
"maskFrame": null,
"layerFrame": {
"x": 11,
"y": 22,
"width": 40,
"height": 40
},
"visible": false,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_cabaret_detail_close-n0u0ntgz.png",
"frame": {
"x": 11,
"y": 22,
"width": 40,
"height": 40
}
},
"children": []
},
{
"objectId": "EC40CB95-C1AB-4944-8808-04A4DEA6C566",
"kind": "group",
"name": "btn_cabaret_detail_back1",
"originalName": "btn_cabaret_detail_back*",
"maskFrame": null,
"layerFrame": {
"x": 21,
"y": 29,
"width": 15,
"height": 26
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_cabaret_detail_back-rum0menc.png",
"frame": {
"x": 21,
"y": 29,
"width": 15,
"height": 26
}
},
"children": []
},
{
"objectId": "4152C383-8177-4662-AB34-34C2B6F54367",
"kind": "group",
"name": "cabaret_ScrollContents1",
"originalName": "cabaret_ScrollContents",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 667,
"width": 377,
"height": 2844
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "532B93C0-7530-4961-BD37-D890EE5D1C74",
"kind": "group",
"name": "cabaret_content1",
"originalName": "cabaret_content*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 667,
"width": 377,
"height": 2844
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-cabaret_content-ntmyqjkz.png",
"frame": {
"x": 0,
"y": 667,
"width": 377,
"height": 2844
}
},
"children": []
}
]
},
{
"objectId": "76D973AD-394F-4F09-BD1D-847142C50B53",
"kind": "group",
"name": "cabaret_background_Image1",
"originalName": "cabaret_background_Image*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-cabaret_background_Image-nzzeotcz.jpg",
"frame": {
"x": 0,
"y": 0,
"width": 375,
"height": 667
}
},
"children": []
}
]
},
{
"objectId": "7E5CF3B1-2616-47B0-8B2A-CC630906FD45",
"kind": "artboard",
"name": "MEINE_TERMINE",
"originalName": "MEINE_TERMINE",
"maskFrame": null,
"layerFrame": {
"x": 4865,
"y": -640,
"width": 375,
"height": 667
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(243.00000071525574, 243.00000071525574, 243.00000071525574, 1)",
"children": [
{
"objectId": "7867BA75-B9B0-45B4-8940-EB807BB2D7E3",
"kind": "group",
"name": "header_meine_termine",
"originalName": "header_meine_termine",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": -189,
"width": 377,
"height": 129
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "04D8D17D-22A3-41BF-B671-F25FE46DEA51",
"kind": "group",
"name": "tabs_meine_termine",
"originalName": "tabs_meine_termine*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": -109,
"width": 377,
"height": 49
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-tabs_meine_termine-mdreoeqx.png",
"frame": {
"x": 0,
"y": -109,
"width": 377,
"height": 49
}
},
"children": []
},
{
"objectId": "73A0DEAC-5E71-40BA-BD7A-18AB7B457358",
"kind": "group",
"name": "btn_meine_termine_back",
"originalName": "btn_meine_termine_back*",
"maskFrame": null,
"layerFrame": {
"x": 21,
"y": -160,
"width": 15,
"height": 26
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_meine_termine_back-nznbmerf.png",
"frame": {
"x": 21,
"y": -160,
"width": 15,
"height": 26
}
},
"children": []
},
{
"objectId": "7996BABD-3047-482F-BBD9-ED3099F4E713",
"kind": "group",
"name": "title_bar_meine_termine",
"originalName": "title_bar_meine_termine*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": -189,
"width": 375,
"height": 88
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-title_bar_meine_termine-nzk5nkjb.png",
"frame": {
"x": 0,
"y": -189,
"width": 375,
"height": 88
}
},
"children": []
}
]
},
{
"objectId": "696371CB-3BFD-48E0-88CE-0BAE76D66716",
"kind": "group",
"name": "meine_termine_list",
"originalName": "meine_termine_list",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": -61,
"width": 375,
"height": 499
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "C34C867F-5B38-4950-B612-8307CA642A27",
"kind": "group",
"name": "Termin_04",
"originalName": "Termin_04",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 312,
"width": 375,
"height": 126
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-Termin_04-qzm0qzg2.png",
"frame": {
"x": 0,
"y": 312,
"width": 375,
"height": 126
}
},
"children": []
},
{
"objectId": "E128FB0C-AF5B-41C2-8B1B-0A2F4D10065D",
"kind": "group",
"name": "Termin_03",
"originalName": "Termin_03",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 188,
"width": 375,
"height": 126
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-Termin_03-rteyoezc.png",
"frame": {
"x": 0,
"y": 188,
"width": 375,
"height": 126
}
},
"children": []
},
{
"objectId": "DB1683CA-6D79-4C5E-A951-FB36ECAE0382",
"kind": "group",
"name": "Termin_02",
"originalName": "Termin_02",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 63,
"width": 375,
"height": 125
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-Termin_02-reixnjgz.png",
"frame": {
"x": 0,
"y": 63,
"width": 375,
"height": 125
}
},
"children": []
},
{
"objectId": "693AB582-6321-41C9-A7EA-96CF301D4EB4",
"kind": "group",
"name": "Termin_01",
"originalName": "Termin_01",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": -61,
"width": 375,
"height": 125
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-Termin_01-njkzqui1.png",
"frame": {
"x": 0,
"y": -61,
"width": 375,
"height": 125
}
},
"children": []
}
]
}
]
},
{
"objectId": "D6B2EE6B-F91E-4F80-ABCB-648961B712A1",
"kind": "artboard",
"name": "stubb_weatherQuarter",
"originalName": "stubb_weatherQuarter",
"maskFrame": null,
"layerFrame": {
"x": -91,
"y": 4173,
"width": 375,
"height": 667
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(255, 255, 255, 1)",
"children": [
{
"objectId": "8A8CE266-EAB9-46E9-A1C1-E2C159AE6B6D",
"kind": "group",
"name": "weatherForecastStuff",
"originalName": "weatherForecastStuff*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 45,
"width": 376,
"height": 536
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-weatherForecastStuff-oee4q0uy.jpg",
"frame": {
"x": 0,
"y": 45,
"width": 376,
"height": 536
}
},
"children": []
}
]
},
{
"objectId": "E30E1C91-4615-4CB1-85A0-D90A3DB99914",
"kind": "artboard",
"name": "stubb_weatherToday",
"originalName": "stubb_weatherToday",
"maskFrame": null,
"layerFrame": {
"x": 478,
"y": 4173,
"width": 375,
"height": 667
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(255, 255, 255, 1)",
"children": [
{
"objectId": "DC382FA9-A977-4E4A-86AD-7539F8808355",
"kind": "group",
"name": "weatherTodayStuff",
"originalName": "weatherTodayStuff*",
"maskFrame": null,
"layerFrame": {
"x": 24,
"y": 45,
"width": 316,
"height": 284
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-weatherTodayStuff-remzodjg.png",
"frame": {
"x": 24,
"y": 45,
"width": 316,
"height": 284
}
},
"children": []
}
]
},
{
"objectId": "47678E8A-E65C-436B-B64F-A84ACE226BF1",
"kind": "artboard",
"name": "stubb_todaytemps",
"originalName": "stubb_todaytemps*",
"maskFrame": null,
"layerFrame": {
"x": 478,
"y": 3519,
"width": 1040,
"height": 144
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(255, 255, 255, 1)",
"image": {
"path": "images/Layer-stubb_todaytemps-ndc2nzhf.jpg",
"frame": {
"x": 478,
"y": 3519,
"width": 1040,
"height": 144
}
},
"children": []
},
{
"objectId": "3B7A3DC4-06F3-4BC3-A8A3-FB2BFAF34850",
"kind": "artboard",
"name": "LIST_RESTAURANTS",
"originalName": "LIST_RESTAURANTS",
"maskFrame": null,
"layerFrame": {
"x": 6052,
"y": -622,
"width": 375,
"height": 2201
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(255, 255, 255, 1)",
"children": [
{
"objectId": "79836C90-0360-46BF-81A4-E7858A77A18B",
"kind": "group",
"name": "btn_frenchkiss",
"originalName": "btn_frenchkiss",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 200
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_frenchkiss-nzk4mzzd.png",
"frame": {
"x": 0,
"y": 0,
"width": 375,
"height": 200
}
},
"children": []
},
{
"objectId": "21777ABB-F63F-4065-BC73-28BB8BBDB6B7",
"kind": "group",
"name": "btn_fuego",
"originalName": "btn_fuego",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 200,
"width": 375,
"height": 200
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_fuego-mje3nzdb.png",
"frame": {
"x": 0,
"y": 200,
"width": 375,
"height": 200
}
},
"children": []
},
{
"objectId": "EF006FDC-28F9-4429-8E9B-6215A91728E3",
"kind": "group",
"name": "btn_marktrest",
"originalName": "btn_marktrest",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 400,
"width": 375,
"height": 200
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_marktrest-ruywmdzg.png",
"frame": {
"x": 0,
"y": 400,
"width": 375,
"height": 200
}
},
"children": []
},
{
"objectId": "62E33B93-8D37-4F6D-A4CE-F449BE222DBD",
"kind": "group",
"name": "btn_casanova",
"originalName": "btn_casanova",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 600,
"width": 375,
"height": 200
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_casanova-njjfmznc.png",
"frame": {
"x": 0,
"y": 600,
"width": 375,
"height": 200
}
},
"children": []
},
{
"objectId": "ABE838BB-758A-4733-9E99-8791B500E698",
"kind": "group",
"name": "btn_sushi",
"originalName": "btn_sushi",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 800,
"width": 375,
"height": 200
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_sushi-qujfodm4.png",
"frame": {
"x": 0,
"y": 800,
"width": 375,
"height": 200
}
},
"children": []
},
{
"objectId": "959D4C03-18AC-411B-935C-C808B6DDCBD6",
"kind": "group",
"name": "btn_east",
"originalName": "btn_east",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1000,
"width": 375,
"height": 200
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_east-otu5rdrd.png",
"frame": {
"x": 0,
"y": 1000,
"width": 375,
"height": 200
}
},
"children": []
},
{
"objectId": "79041744-7B5B-4C3B-BEE2-FDC1308247D0",
"kind": "group",
"name": "restBackImg",
"originalName": "restBackImg*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": -1,
"width": 375,
"height": 2202
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-restBackImg-nzkwnde3.jpg",
"frame": {
"x": 0,
"y": -1,
"width": 375,
"height": 2202
}
},
"children": []
},
{
"objectId": "77ED96F8-283A-4366-B712-9FF32F3244C3",
"kind": "group",
"name": "btn_brauhaus",
"originalName": "btn_brauhaus",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1200,
"width": 375,
"height": 200
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_brauhaus-nzdfrdk2.png",
"frame": {
"x": 0,
"y": 1200,
"width": 375,
"height": 200
}
},
"children": []
},
{
"objectId": "81125A23-8E6E-4754-88F1-A50F1C31180D",
"kind": "group",
"name": "btn_weitewelt",
"originalName": "btn_weitewelt",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1400,
"width": 375,
"height": 200
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_weitewelt-odexmjvb.png",
"frame": {
"x": 0,
"y": 1400,
"width": 375,
"height": 200
}
},
"children": []
},
{
"objectId": "32D722F4-5657-4055-83A4-8A002C69F21F",
"kind": "group",
"name": "btn_belladonna",
"originalName": "btn_belladonna",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1600,
"width": 375,
"height": 200
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_belladonna-mzjenziy.png",
"frame": {
"x": 0,
"y": 1600,
"width": 375,
"height": 200
}
},
"children": []
},
{
"objectId": "F8E7BC8E-049D-43A7-846C-C3E00EAF10E6",
"kind": "group",
"name": "btn_buffalo",
"originalName": "btn_buffalo",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1800,
"width": 375,
"height": 200
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_buffalo-rjhfn0jd.png",
"frame": {
"x": 0,
"y": 1800,
"width": 375,
"height": 200
}
},
"children": []
},
{
"objectId": "01FA8989-3908-48C6-9D31-4474F9B8A442",
"kind": "group",
"name": "btn_rossini",
"originalName": "btn_rossini",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 2000,
"width": 375,
"height": 200
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_rossini-mdfgqtg5.png",
"frame": {
"x": 0,
"y": 2000,
"width": 375,
"height": 200
}
},
"children": []
}
]
},
{
"objectId": "37C643AF-D0EB-4A10-929B-B0F6DC7F9605",
"kind": "artboard",
"name": "LIST_EVENTS",
"originalName": "LIST_EVENTS",
"maskFrame": null,
"layerFrame": {
"x": 5503,
"y": -622,
"width": 375,
"height": 1929
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(34, 34, 34, 1)",
"children": [
{
"objectId": "13384283-6B78-4BDE-9297-E757CF130F45",
"kind": "group",
"name": "btn_event01",
"originalName": "btn_event01*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 139,
"width": 375,
"height": 201
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_event01-mtmzodqy.png",
"frame": {
"x": 0,
"y": 139,
"width": 375,
"height": 201
}
},
"children": []
},
{
"objectId": "08609E99-BC2A-45F4-8635-348E1AFD9431",
"kind": "group",
"name": "btn_event02",
"originalName": "btn_event02",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 340,
"width": 375,
"height": 201
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_event02-mdg2mdlf.png",
"frame": {
"x": 0,
"y": 340,
"width": 375,
"height": 201
}
},
"children": [
{
"objectId": "F8239F72-D1C6-4AE2-A4CE-5B1FD1FC964A",
"kind": "group",
"name": "molecules_label_events",
"originalName": "molecules/label/events",
"maskFrame": null,
"layerFrame": {
"x": 25,
"y": 455,
"width": 211,
"height": 64
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "7FE66D0B-94CA-4806-B6C0-C181771D44AE",
"kind": "group",
"name": "Stacked_Group",
"originalName": "Stacked Group",
"maskFrame": null,
"layerFrame": {
"x": 25,
"y": 455,
"width": 211,
"height": 64
},
"visible": true,
"metadata": {
"opacity": 1
},
"children": [
{
"objectId": "028E4AC9-FB15-42A6-9362-96648C788E67",
"kind": "text",
"name": "Stacked_Group1",
"originalName": "Stacked Group",
"maskFrame": null,
"layerFrame": {
"x": 25,
"y": 476,
"width": 211,
"height": 43
},
"visible": true,
"metadata": {
"opacity": 1,
"string": "Fotoshooting: Porträts am Bug",
"css": [
"/* ✎ Event Name: */",
"font-family: FrutigerLTStd-Bold;",
"font-size: 24px;",
"color: #FFFFFF;",
"letter-spacing: -0.38px;",
"line-height: 24px;"
]
},
"image": {
"path": "images/Layer-Stacked_Group-mdi4rtrb.png",
"frame": {
"x": 25,
"y": 476,
"width": 211,
"height": 43
}
},
"children": []
},
{
"objectId": "5501FAF2-A3C5-4B79-9950-CB869CBF999C",
"kind": "group",
"name": "time",
"originalName": "time",
"maskFrame": null,
"layerFrame": {
"x": 26,
"y": 455,
"width": 110,
"height": 14
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-time-ntuwmuzb.png",
"frame": {
"x": 26,
"y": 455,
"width": 110,
"height": 14
}
},
"children": []
}
]
}
]
}
]
},
{
"objectId": "85B7BB4D-6AF1-48C4-A2E3-7234BB307D20",
"kind": "group",
"name": "btn_event03",
"originalName": "btn_event03*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 541,
"width": 375,
"height": 200
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_event03-odvcn0jc.png",
"frame": {
"x": 0,
"y": 541,
"width": 375,
"height": 200
}
},
"children": []
},
{
"objectId": "0AFBC46A-29FF-4916-B004-442E61C11B12",
"kind": "group",
"name": "btn_event04",
"originalName": "btn_event04*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 781,
"width": 375,
"height": 201
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_event04-mefgqkm0.png",
"frame": {
"x": 0,
"y": 781,
"width": 375,
"height": 201
}
},
"children": []
},
{
"objectId": "4D12CF6A-5CF4-4F3B-B83F-4A37163BA201",
"kind": "group",
"name": "btn_event05",
"originalName": "btn_event05*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 982,
"width": 375,
"height": 201
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_event05-neqxmkng.png",
"frame": {
"x": 0,
"y": 982,
"width": 375,
"height": 201
}
},
"children": []
},
{
"objectId": "50BFDCEA-9299-4E95-80E3-20748BE50F2E",
"kind": "group",
"name": "btn_event06",
"originalName": "btn_event06*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1183,
"width": 375,
"height": 201
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_event06-ntbcrkrd.png",
"frame": {
"x": 0,
"y": 1183,
"width": 375,
"height": 201
}
},
"children": []
},
{
"objectId": "0412B59F-B73E-4523-85E7-EF72E1D2057F",
"kind": "group",
"name": "btn_event07",
"originalName": "btn_event07*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1384,
"width": 375,
"height": 200
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_event07-mdqxmki1.png",
"frame": {
"x": 0,
"y": 1384,
"width": 375,
"height": 200
}
},
"children": []
},
{
"objectId": "5BA439E8-07CC-4AC5-B9CE-E06CFFFDE353",
"kind": "group",
"name": "btn_event08",
"originalName": "btn_event08*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1624,
"width": 375,
"height": 201
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-btn_event08-nujbndm5.png",
"frame": {
"x": 0,
"y": 1624,
"width": 375,
"height": 201
}
},
"children": []
},
{
"objectId": "0B4EC70E-82F0-4FFA-8817-2822591F7318",
"kind": "group",
"name": "ignoreThis",
"originalName": "ignoreThis*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": -61,
"width": 375,
"height": 1685
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-ignoreThis-mei0rum3.png",
"frame": {
"x": 0,
"y": -61,
"width": 375,
"height": 1685
}
},
"children": []
}
]
},
{
"objectId": "517486C2-1C67-4391-8B31-B54320FCC975",
"kind": "artboard",
"name": "LIST_EVENTS_ENTDECKEN",
"originalName": "LIST_EVENTS_ENTDECKEN",
"maskFrame": null,
"layerFrame": {
"x": 6606,
"y": -622,
"width": 375,
"height": 2272
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(34.00000177323818, 34.00000177323818, 34.00000177323818, 1)",
"image": {
"path": "images/Layer-LIST_EVENTS_ENTDECKEN-nte3ndg2.png",
"frame": {
"x": 6606,
"y": -622,
"width": 375,
"height": 2272
}
},
"children": [
{
"objectId": "F3E87CAF-7621-489E-9A4D-4ABE0DC4DCD8",
"kind": "group",
"name": "entdecken_champagner_trigger",
"originalName": "entdecken champagner trigger",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1605,
"width": 375,
"height": 168
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-entdecken_champagner_trigger-rjnfoddd.png",
"frame": {
"x": 0,
"y": 1605,
"width": 375,
"height": 168
}
},
"children": []
},
{
"objectId": "DA654264-ACAE-43BF-AA66-6B28AFC6A2CF",
"kind": "group",
"name": "entdecken_gin_probe",
"originalName": "entdecken gin probe",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 1269,
"width": 375,
"height": 168
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-entdecken_gin_probe-ree2ntqy.png",
"frame": {
"x": 0,
"y": 1269,
"width": 375,
"height": 168
}
},
"children": []
},
{
"objectId": "FF746AB0-B8FD-4417-8F4B-A36E9778D891",
"kind": "group",
"name": "entdecken_back",
"originalName": "entdecken back",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 30,
"width": 46,
"height": 42
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-entdecken_back-rky3ndzb.png",
"frame": {
"x": 0,
"y": 30,
"width": 46,
"height": 42
}
},
"children": []
},
{
"objectId": "051D3041-A12F-4A66-8E2F-5D0FFD1F5810",
"kind": "group",
"name": "cabaret_trigger",
"originalName": "cabaret trigger",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 81,
"width": 375,
"height": 335
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-cabaret_trigger-mduxrdmw.png",
"frame": {
"x": 0,
"y": 81,
"width": 375,
"height": 335
}
},
"children": []
},
{
"objectId": "53111C3B-ADD1-497A-BC1B-1BD4415E9FDC",
"kind": "group",
"name": "entdecken_static_",
"originalName": "entdecken static ",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 375,
"height": 1605
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-entdecken_static_-ntmxmtfd.png",
"frame": {
"x": 0,
"y": 0,
"width": 375,
"height": 1605
}
},
"children": []
}
]
},
{
"objectId": "62C1164D-E914-430C-9F97-05289C8B3DC0",
"kind": "artboard",
"name": "myday_restaurants",
"originalName": "myday_restaurants",
"maskFrame": null,
"layerFrame": {
"x": 4439,
"y": 4503,
"width": 1819,
"height": 193
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(255, 255, 255, 1)",
"children": [
{
"objectId": "DD1E0970-55EF-4209-B439-F268E9D51BFB",
"kind": "group",
"name": "mydayRest01",
"originalName": "mydayRest01*",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 345,
"height": 193
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-mydayRest01-reqxrta5.png",
"frame": {
"x": 0,
"y": 0,
"width": 345,
"height": 193
}
},
"children": []
},
{
"objectId": "3F486CD7-E85D-4067-8637-28481FAD39FD",
"kind": "group",
"name": "mydayRest02",
"originalName": "mydayRest02*",
"maskFrame": null,
"layerFrame": {
"x": 346,
"y": 0,
"width": 367,
"height": 193
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-mydayRest02-m0y0odzd.png",
"frame": {
"x": 346,
"y": 0,
"width": 367,
"height": 193
}
},
"children": []
},
{
"objectId": "3949B2BC-4329-4828-9D3D-618E1CD1C640",
"kind": "group",
"name": "mydayRest03",
"originalName": "mydayRest03*",
"maskFrame": null,
"layerFrame": {
"x": 712,
"y": 0,
"width": 367,
"height": 193
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-mydayRest03-mzk0ouiy.png",
"frame": {
"x": 712,
"y": 0,
"width": 367,
"height": 193
}
},
"children": []
},
{
"objectId": "4B91216E-14D2-43FC-B482-A51ECCBF2A93",
"kind": "group",
"name": "mydayRest04",
"originalName": "mydayRest04*",
"maskFrame": null,
"layerFrame": {
"x": 1080,
"y": 0,
"width": 367,
"height": 193
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-mydayRest04-nei5mtix.png",
"frame": {
"x": 1080,
"y": 0,
"width": 367,
"height": 193
}
},
"children": []
},
{
"objectId": "8A9C5F6B-2CF8-4730-9BF8-43DAA91C0A3F",
"kind": "group",
"name": "mydayRest05",
"originalName": "mydayRest05*",
"maskFrame": null,
"layerFrame": {
"x": 1446,
"y": 0,
"width": 373,
"height": 193
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-mydayRest05-oee5qzvg.png",
"frame": {
"x": 1446,
"y": 0,
"width": 373,
"height": 193
}
},
"children": []
}
]
},
{
"objectId": "7B05047C-9B9C-4DA4-8005-83690AE221AC",
"kind": "artboard",
"name": "myday_events01",
"originalName": "myday_events01",
"maskFrame": null,
"layerFrame": {
"x": 4439,
"y": 3236,
"width": 1733,
"height": 193
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(255, 255, 255, 1)",
"children": [
{
"objectId": "238D3A91-3AD2-4AD9-ABCB-5FB4A7ECC945",
"kind": "group",
"name": "mydayEvent01",
"originalName": "mydayEvent01*",
"maskFrame": null,
"layerFrame": {
"x": 16,
"y": -13,
"width": 320,
"height": 206
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-mydayEvent01-mjm4rdnb.png",
"frame": {
"x": 16,
"y": -13,
"width": 320,
"height": 206
}
},
"children": []
},
{
"objectId": "567F6C2A-E19E-4E33-B48C-48A6B046623D",
"kind": "group",
"name": "mydayEvent02",
"originalName": "mydayEvent02*",
"maskFrame": null,
"layerFrame": {
"x": 360,
"y": -13,
"width": 320,
"height": 206
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-mydayEvent02-nty3rjzd.png",
"frame": {
"x": 360,
"y": -13,
"width": 320,
"height": 206
}
},
"children": []
},
{
"objectId": "936D911A-1B3C-4D09-8D45-A6A3659D277E",
"kind": "group",
"name": "mydayEvent03",
"originalName": "mydayEvent03*",
"maskFrame": null,
"layerFrame": {
"x": 704,
"y": 0,
"width": 320,
"height": 193
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-mydayEvent03-otm2rdkx.png",
"frame": {
"x": 704,
"y": 0,
"width": 320,
"height": 193
}
},
"children": []
},
{
"objectId": "A1EA7C66-DDD0-4565-BBBA-4CD6C87EDB98",
"kind": "group",
"name": "mydayEvent04",
"originalName": "mydayEvent04*",
"maskFrame": null,
"layerFrame": {
"x": 1049,
"y": -5,
"width": 320,
"height": 218
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-mydayEvent04-qtffqtdd.png",
"frame": {
"x": 1049,
"y": -5,
"width": 320,
"height": 218
}
},
"children": []
},
{
"objectId": "DD46EAF2-5857-4DD5-A5A8-3327B4B22671",
"kind": "group",
"name": "mydayEvent05",
"originalName": "mydayEvent05*",
"maskFrame": null,
"layerFrame": {
"x": 1392,
"y": 0,
"width": 320,
"height": 193
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-mydayEvent05-req0nkvb.png",
"frame": {
"x": 1392,
"y": 0,
"width": 320,
"height": 193
}
},
"children": []
}
]
},
{
"objectId": "0F7C96B9-1186-41B6-AE82-AAB327FAC04A",
"kind": "artboard",
"name": "myday_schedule",
"originalName": "myday_schedule",
"maskFrame": null,
"layerFrame": {
"x": 4439,
"y": 2905,
"width": 1400,
"height": 143
},
"visible": true,
"metadata": {},
"backgroundColor": "rgba(255, 255, 255, 1)",
"children": [
{
"objectId": "6AEF4D37-247B-4E03-977F-3F57F0750BB7",
"kind": "group",
"name": "spacers",
"originalName": "spacers",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": -56,
"width": 1048,
"height": 279
},
"visible": false,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-spacers-nkffrjre.png",
"frame": {
"x": 0,
"y": -56,
"width": 1048,
"height": 279
}
},
"children": []
},
{
"objectId": "3A0F24FF-BDC6-4D50-8B20-E34567167FFF",
"kind": "group",
"name": "myDayMyEventsEvent03",
"originalName": "myDayMyEventsEvent03",
"maskFrame": null,
"layerFrame": {
"x": 347,
"y": 0,
"width": 348,
"height": 143
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-myDayMyEventsEvent03-m0ewrji0.png",
"frame": {
"x": 347,
"y": 0,
"width": 348,
"height": 143
}
},
"children": []
},
{
"objectId": "DD512233-A7EA-40A0-8525-B3C1130FF373",
"kind": "group",
"name": "myDayMyEventsEvent01",
"originalName": "myDayMyEventsEvent01",
"maskFrame": null,
"layerFrame": {
"x": 0,
"y": 0,
"width": 348,
"height": 143
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-myDayMyEventsEvent01-req1mtiy.png",
"frame": {
"x": 0,
"y": 0,
"width": 348,
"height": 143
}
},
"children": []
},
{
"objectId": "8B2B58AC-474F-40E4-BBFB-2977E8BA2692",
"kind": "group",
"name": "myDayMyEventsEvent02",
"originalName": "myDayMyEventsEvent02",
"maskFrame": null,
"layerFrame": {
"x": 695,
"y": 0,
"width": 345,
"height": 143
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-myDayMyEventsEvent02-oeiyqju4.png",
"frame": {
"x": 695,
"y": 0,
"width": 345,
"height": 143
}
},
"children": []
},
{
"objectId": "6CD7866E-4D4D-4E88-8A23-2EAB7CC1192F",
"kind": "group",
"name": "myDayMyEventsEvent04",
"originalName": "myDayMyEventsEvent04",
"maskFrame": null,
"layerFrame": {
"x": 1039,
"y": 0,
"width": 356,
"height": 143
},
"visible": true,
"metadata": {
"opacity": 1
},
"image": {
"path": "images/Layer-myDayMyEventsEvent04-nknenzg2.png",
"frame": {
"x": 1039,
"y": 0,
"width": 356,
"height": 143
}
},
"children": []
}
]
}
]
|
const express = require('express');
const mongoose = require('mongoose');
const { ensureAuthenticated } =require('../helpers/auth');
const router =express.Router();
//import post schema
require('../Model/Post');
const Post = mongoose.model('posts') //posts here is of post.js 'mongoose.model('posts',PostSchema);' from here.
//............................................................
//for retrieving the data from path
// router.get('/',(req,res)=>{
// res.render('./index.handlebars');
// });
router.get("/addpost", ensureAuthenticated,(req,res)=>{
res.render('./posts/addpost.handlebars');
});
router.get("/",ensureAuthenticated,(req,res)=>{
Post.find({}).sort({date : 'desc'}).then(postss =>{
res.render('./posts/postData.handlebars' , {
postss:postss
});
}).catch(err => console.log(err));
});
//.................................................
//post create method (post method)
router.post('/addpost',ensureAuthenticated,(req,res)=>{
const errors =[];
if(!req.body.title){
errors.push({text:'Please add title'});
}
if(!req.body.details){
errors.push({text1: 'please add details'});
}
if(errors.length>0){
res.render('./posts/addpost.handlebars',{
errors,
title: req.body.title,
details:req.body.details
})
} else{
const NewPost = {
title: req.body.title,
details:req.body.details
}
new Post(NewPost).save().then(post =>{
req.flash('success_msg','successfully Added');
res.redirect('/posts');
}).catch(err => console.log(err));
}
});
//............................................
// update posts Headers...
router.get('/edit/:id',(req,res)=>{
Post.findOne({_id:req.params.id}).then(postsss=>{
res.render('./posts/editpost.handlebars',{postsss:postsss});
})
});
// update PUT method
router.put('/edit/:id', ensureAuthenticated,(req,res)=>{
Post.findOne({_id:req.params.id}).then(post =>{
//new data
post.title=req.body.title;
post.details =req.body.details;
post.save().then(post =>{
req.flash('success_msg','successfully updated');
res.redirect('/posts');
}).console.log(err =>console.log(err));
})
});
// //......................................................
//delete data by delete method
router.delete('/deletepost/:id',ensureAuthenticated,(req,res)=>{
Post.remove({_id:req.params.id}).then(()=>{
req.flash('errors_msg','successfully Deleted');
res.redirect('/posts');
})
});
module.exports = router;
|
/*!
*
* Copyright 2014-2020 大连文森特北京分公司
*
* 子弹管理类
*
* 作者: 杜金贵
*
*/
var vt = vt = vt || {};
//子弹池管理类
vt.VTBulletPoolManager = cc.Class.extend({
_bulletPools:null,
_bAutoRemove:null, //自动销毁
ctor:function(){
this._bulletPools = [];
},
init:function(){
},
/**
* [创建子弹池]
* @param {[string]} imgPath [子弹图片路径]
* @param {[cc.node]} parent [子弹的父节点]
* @param {[cc.node]} sprite [子弹属发射者]
* @param {[Object]} propertys [子弹属性集合]
* @param {[string]} id [子弹唯一标示]
*/
createBulletPool:function(imgPath,parent,sprite,propertys,id){
var bulletPool = vt.VTBulletPool.create(imgPath,parent,sprite,propertys,id);
if(bulletPool){
this._bulletPools.push(bulletPool);
return bulletPool;
}
return null;
},
getBulletPoolByID:function(id){
var bulletPools = this._bulletPools;
var bulletPool = null;
for(var i = 0;i < bulletPools.length; ++i){
if(bulletPools[i] && bulletPools[i].getSoleID() === id)
{
bulletPool = bulletPools[i];
break;
}
}
return bulletPool;
},
getBulletPoolHitBullets: function(id){
var bulletPool = this.getBulletPoolByID(id);
var hitBullets = [];
if (bulletPool) {
hitBullets = bulletPool.getHitBullets();
}
return hitBullets;
},
/**
* 自动销毁
*/
setAutoRemove: function(bAutoRemove){
this._bAutoRemove = bAutoRemove;
},
isAutoRemove: function(){
return this._bAutoRemove;
}
});
//子弹池类
vt.VTBulletPool = cc.Class.extend({
_bullets:null, //所有的子弹数组
_hitBullerts:null,//所有碰撞子弹
_imgPath: null,
MaxBulletNum:null,
_soleID:null, //对象池唯一标示
ctor: function(){
this._bullets = [];
this._imgPath = "";
this.MaxBulletNum = 20;
this._soleID = 0;
this._bAutoRemove = true;
},
init: function(imgPath,parent,sprite,propertys,id){
this._imgPath = imgPath;
this._soleID = id;
if(!this._initBulletManager(parent,sprite,propertys)){
return false;
}
return true;
},
/**
* [初始化子弹池]
* @param {[string]} imgPath [子弹图片路径]
* @param {[cc.node]} parent [子弹的父节点]
* @param {[Object]} propertys [子弹属性集合]
* @return {[bool]} [子弹池是否初始化成功]
*/
_initBulletManager:function(parent,sprite,propertys){
this._setBulletImage(this._imgPath);
for(var i = 0;i < this.MaxBulletNum;i ++){
var bullet = this._createBullet();
if(!bullet){
console.log('Failed to initialize the bullets.');
return false;
}
bullet.setOffset(0, 0);
bullet.setLaunchMode(propertys.launchMode);
bullet.setLaunchSpeed(parseFloat(propertys.flySpeed));
bullet.setOwner(sprite);
bullet.setUsed(false);
parent.addChild(bullet);
}
return true;
},
/**
* 获得一个未使用的子弹
*/
getBullet: function(){
var bullets = this._bullets;
var bullet = null;
for(var i = 0;i < bullets.length;i ++){
if(bullets[i] && !bullets[i].getUsed()){
bullet = bullets[i];
break;
}
}
return bullet;
},
/**
* 得到所有碰撞子弹
*/
getHitBullets: function(){
var bullets = this._bullets;
this._hitBullerts = [];
var nCount = bullets.length;
for(var i = 0;i < nCount;i ++){
if (bullets[i]){
if (bullets[i].getHitState()){
this._hitBullerts.push(bullets[i]);
}
}
}
return this._hitBullerts;
},
setSoleID:function(id){
this._soleID = id;
},
getSoleID:function(){
return this._soleID;
},
/**
* 设置子弹图片
*/
_setBulletImage: function(imgpath){
this._imgPath = imgpath;
},
/**
* 创建一个子弹
*/
_createBullet: function(){
var imgpath = this._imgPath;
var bullet = vt.VTBullet.create(imgpath);
this._bullets.push(bullet);
return bullet;
}
});
vt.VTBulletPool.create = function(imgPath,parent,sprite,propertys,id){
var bulletPool = new vt.VTBulletPool();
if(bulletPool && bulletPool.init(imgPath,parent,sprite,propertys,id)){
return bulletPool;
}
return null;
}
vt.VTBulletPoolManager.getInstance = function () {
if (!this._instance) {
this._instance = this._instance || new vt.VTBulletPoolManager();
this._instance.init();
}
return this._instance;
}
|
console.log("2/3: async script");
|
import React, { useEffect } from 'react';
import { Grid } from '@material-ui/core';
import PostForm from './PostForm';
import { useSelector, useDispatch } from 'react-redux';
import Post from './Post';
import { FETCH_POSTS } from '../app/actions';
import ScrollToTopFab from './ScrollToTopFab';
function MainPage() {
const posts = [...useSelector((state) => state.posts)];
posts.sort((a, b) => new Date(b.created_at) - new Date(a.created_at));
const dispatch = useDispatch();
useEffect(() => {
console.log('[Fetching posts from useEffect]')
dispatch({ type: FETCH_POSTS });
}, [dispatch])
return (
<Grid
justify="center"
container style={{ marginTop: 70 }}
>
<ScrollToTopFab />
<Grid item xs sm={8} md={5} xl={4} >
<PostForm />
{
posts.map(({ id, ...rest }) => (
<Post key={id} id={id} {...rest}/>
))
}
</Grid>
</Grid>
);
}
export default MainPage;
|
(function($) {
'use strict';
var modify = function(){
if($("#singleprice").text() == -1)
$("#singlecol").hide();//.css('visibility', 'hidden');
if($("#doubleprice").text() == -1)
$("#singlecol").hide();//.css('visibility', 'hidden');
if($("#quadprice").text() == -1)
$("#singlecol").hide();//.css('visibility', 'hidden');
}
modify();
var tmp = Math.floor(Math.random()*4 +1);
$("#singleimg").attr("src","images/type_room_picture/singleroom_" + tmp + ".jpg");
$("#doubleimg").attr("src","images/type_room_picture/doubleroom_" + tmp + ".jpg");
$("#quadimg").attr("src","images/type_room_picture/quadroom_" + tmp + ".jpg");
$("#reservebutton").attr("disabled", true); //default
var onceChange = function(){
var singledaytotal = ($("#numofSingle").val() * $("#singleprice").text() + $("#numofDouble").val() * $("#doubleprice").text() + $("#numofQuad").val() * $("#quadprice").text());
$("#singledayprice").attr("value", singledaytotal);
$("#totalprice").attr("value", $("#staydays").val() * singledaytotal);
var bookroom = parseInt($("#numofSingle").val()) + parseInt($("#numofDouble").val()) + parseInt($("#numofQuad").val());
//console.log(bookroom);
if(bookroom <= 0)
$("#reservebutton").attr("disabled", true);
else
$("#reservebutton").attr("disabled", false);
return;
};
$("#numofSingle").change(onceChange);
$("#numofDouble").change(onceChange);
$("#numofQuad").change(onceChange);
})(jQuery);
|
export { default } from 'ember-cli-flipdown/components/flip-down';
|
const express = require('express')
const router = express.Router()
const {upload} = require("../../functions/upload")
const resize = require("../../functions/resize")
const controller = require("../../controllers/admin/settings")
const is_admin = require("../../middleware/admin/is-admin")
router.get('/settings',is_admin, controller.settings);
router.post('/settings',is_admin, controller.settings);
router.get('/settings/email',is_admin, controller.emails);
router.post('/settings/email',is_admin, controller.emails);
router.get('/settings/login',is_admin, controller.login);
router.post('/settings/login',is_admin, controller.login);
router.get('/settings/recaptcha',is_admin, controller.recaptcha);
router.post('/settings/recaptcha',is_admin, controller.recaptcha);
router.get('/settings/s3',is_admin, controller.s3);
router.post('/settings/s3',is_admin, controller.s3);
router.get('/settings/newsletter',is_admin, controller.newsletter);
router.post('/settings/newsletter',is_admin, controller.newsletter);
router.get('/settings/contact',is_admin, controller.contact);
router.post('/settings/contact',is_admin, controller.contact);
router.get('/settings/signup',is_admin, controller.signup);
router.post('/settings/signup',is_admin, controller.signup);
router.get('/settings/otp',is_admin, controller.otp);
router.post('/settings/otp',is_admin, controller.otp);
router.get('/pwa',is_admin, controller.pwa);
router.post('/pwa',is_admin, controller.pwa);
module.exports = router;
|
import React from 'react';
import { tokens } from '@sparkpost/design-tokens';
import { getWindow } from '../helpers/window';
// Defining queries here to ensure order is correct
const queries = [
`(min-width: ${tokens.mediaQuery_xl})`,
`(min-width: ${tokens.mediaQuery_lg})`,
`(min-width: ${tokens.mediaQuery_md})`,
`(min-width: ${tokens.mediaQuery_sm})`,
`(min-width: ${tokens.mediaQuery_xs})`,
];
// This order must be the same as above
const keys = ['xl', 'lg', 'md', 'sm', 'xs'];
/**
* Hook that returns token breakpoint status based on window width
*
* @example
* const breakpoint = useBreakpoint();
*
* Possible `breakpoint` values:
* ['xl', 'lg', 'md', 'sm', 'xs', 'default'];
*
* @see https://usehooks.com/useMedia/
*/
function useBreakpoint() {
const environment = getWindow();
const list = queries.map(q => environment.matchMedia(q));
function getValue() {
// Get index of first media query that matches
const index = list.findIndex(mql => mql.matches);
// Return related value or 'default' if none (smaller than xs size)
return typeof keys[index] !== 'undefined' ? keys[index] : 'default';
}
// State and setter for matched value
const [value, setValue] = React.useState(getValue);
React.useEffect(
() => {
// Event listener callback
// Note: By defining getValue outside of useEffect we ensure that it has
// current values of hook args (as this hook callback is created once on mount).
const handler = () => setValue(getValue);
// Set a listener for each media query with above handler as callback.
list.forEach(mql => mql.addListener(handler));
// Remove listeners on cleanup
return () => list.forEach(mql => mql.removeListener(handler));
},
[], // Empty array ensures effect is only run on mount and unmount
);
return value;
}
export default useBreakpoint;
|
'use strict'
const chalk = require('chalk')
module.exports = {
usageCommandPlaceholder: s => chalk.magenta(s),
usagePositionals: s => chalk.yellow(s),
usageArgsPlaceholder: s => chalk.yellow(s),
usageOptionsPlaceholder: s => chalk.green(s),
group: s => chalk.white(s),
flags: (s, type) => {
if (type.datatype === 'command') {
s = s.split(' ')
return chalk.magenta(s[0]) + (s[1] ? ' ' + chalk.yellow(s.slice(1).join(' ')) : '')
}
if (s.startsWith('<') || s.startsWith('[')) return chalk.yellow(s)
return chalk.green(s)
},
desc: s => chalk.cyan(s),
hints: s => chalk.dim(s),
groupError: s => chalk.red(s),
flagsError: s => chalk.red(s),
descError: s => chalk.red(s),
hintsError: s => chalk.red(s),
messages: s => chalk.red(s)
}
|
const jwt = require("jsonwebtoken");
const keys = require("../config/keys");
const Model = require("../model/user");
const { emailSendVerification } = require("./nodemailer");
const {
validateUsername,
validateFirstName,
validatePassword,
validateLastName,
validateEmail,
checkUsername,
checkEmail
} = require("../validation/validation");
const createJwtToken = payload => {
return jwt.sign(payload, keys.jwt, { expiresIn: 3600 * 24 * 30 });
};
const googleAuth = (req, res) => {
let token = createJwtToken({ _id: req.user._id, connectionType: req.user.connectionType, username: req.user.username, picture: req.user.picture });
res.redirect(`http://localhost:3000/?token=${token}`);
};
const githubAuth = (req, res) => {
let token = createJwtToken({ _id: req.user._id, connectionType: req.user.connectionType, username: req.user.username, picture: req.user.picture });
res.redirect(`http://localhost:3000/?token=${token}`);
};
const facebookAuth = (req, res) => {
let token = createJwtToken({ _id: req.user._id, connectionType: req.user.connectionType, username: req.user.username, picture: req.user.picture });
res.redirect(`http://localhost:3000/?token=${token}`);
};
const the42Auth = (req, res) => {
let token = createJwtToken({ _id: req.user._id, connectionType: req.user.connectionType, username: req.user.username, picture: req.user.picture });
res.redirect(`http://localhost:3000/?token=${token}`);
};
const localSignInAuth = async (req, res) => {
const currentUser = await Model.User.findOne({
username: req.body.username
});
if (!currentUser) {
res.status(200).json({
success: false,
msg: "Wrong username or password"
});
} else {
if (currentUser.connectionType !== "local") {
res.status(200).json({
success: false,
msg: "This user is registered with OAuth"
});
} else if (!(await currentUser.isValidPassword(req.body.password))) {
res.status(200).json({
success: false,
msg: "Wrong username or password"
});
} else {
if (!currentUser.verified) {
res.status(200).json({
success: false,
msg: "Please verify your email address"
});
} else {
const payload = {_id: currentUser._id, connectionType: currentUser.connectionType, username: currentUser.username, picture: currentUser.picture };
let token = createJwtToken(payload);
res.status(200).json({
success: true,
token: token
});
}
}
}
};
const localSignUpAuth = async (req, res) => {
let errors = {};
if (!validateUsername(req.body.username)) errors.username = true;
if (!(await checkUsername(req.body.username)))
errors.duplicateUsername = true;
if (!validateEmail(req.body.email)) errors.email = true;
if (!(await checkEmail(req.body.email))) errors.duplicateEmail = true;
if (!validateFirstName(req.body.firstName)) errors.firstName = true;
if (!validateLastName(req.body.lastName)) errors.lastName = true;
if (!validatePassword(req.body.password)) errors.password = true;
if (!req.file) errors.picture = true;
if (Object.keys(errors).length > 0) {
res.json({ success: false, errors });
} else {
let currentUser = new Model.User({
firstName: req.body.firstName,
lastName: req.body.lastName,
username: req.body.username,
email: req.body.email,
picturePath: req.file.path,
password: req.body.password,
connectionType: "local"
})
currentUser.picture = `http://localhost:8145/auth/getlocalpicture/${currentUser._id}`
currentUser.save()
.then(() => {
emailSendVerification(req, res);
});
}
};
module.exports = exports = {
googleAuth,
the42Auth,
facebookAuth,
githubAuth,
localSignUpAuth,
localSignInAuth,
createJwtToken
};
|
var router = require('express').Router(),
_ = require('underscore');
// DEFINE DEFAULTS
var basePath = "/",
allPaths = [];
// build up a 'page navigation' object from the page data, suitable for rendering
var navigationData = {};
var routerOptions;
var handler = function (req, res) {
// Issue with this object is defined as the content object
// instead of the the binding elems from the addRoutes function
// console.log('handing a page request:', allPaths);
res.render(this.view, {
content: this.content,
navigation: navigationData
});
};
var addroute = function (path, data) {
allPaths.push({ url: path.replace(/^\//, '') }); // relative links for sitemap
// console.log("ADDROUTE:", path);
router.get(path, handler.bind(data));
return { url: data.optional_path || path, label: data.title }; // return our nav fragment
}
var addRoutes = function (contentObj, navData, parentDir) {
// console.log('content element:', contentObj);
_.each(contentObj, function (pageData, pathFragment) {
// only test we need is if the content object exists
// and is not an underscore-prefixed fragment object...
if (/^_/.test(pathFragment)) return;
pathFragment = pathFragment.replace(/^@/, '');
pDir = parentDir ? parentDir : "";
// console.log('page content for:', pathFragment);
if (pageData.content) { //
// pathFragment replace @ prefix if present, to avoid file VS directory conflicts
pathFragment = pathFragment.replace(/^@/, '');
var path = basePath + pDir + pathFragment + '.html';
navData[pathFragment] = addroute(path, pageData);
} else {
// console.log('adding sub routes:', pathFragment, pageData);
navData[pathFragment] = navData[pathFragment] || {};
// could check for a secondary key or path in pageData.isIndexPage - render as path/
addRoutes(pageData, navData[pathFragment], pDir + pathFragment + "/");
}
});
return router;
};
module.exports = function (contentDir, options) {
routerOptions = options || {};
var content = require('require-dir')(contentDir, { recurse: true });
// console.log('nav data start:', navigationData);
var ourRouter = addRoutes(content, navigationData);
// console.log('nav data check', navigationData);
if (routerOptions.sitemap) {
ourRouter.get("/sitemap", handler.bind({ view: routerOptions.sitemap, content: { sitemap: allPaths } }));
}
return ourRouter;
}
|
const {
GraphQLObjectType,
GraphQLString,
GraphQLFloat,
GraphQLNonNull,
} = require("graphql");
const {
createUser,
updateUser,
deleteUser,
} = require("../resolvers/userResolver");
const {
createActivity,
updateActivity,
deleteActivity,
} = require("../resolvers/activityResolver");
const {
createMeal,
updateMeal,
deleteMeal,
} = require("../resolvers/mealResolver");
const {
createFood,
updateFood,
deleteFood,
} = require("../resolvers/foodResolver");
const RootMutationType = new GraphQLObjectType({
name: "RootMutation",
description: "Root Mutation",
fields: () => ({
createUser: {
description: "This type creates a user.",
type: GraphQLNonNull(GraphQLString),
args: {
username: {
type: GraphQLNonNull(GraphQLString),
},
password: {
type: GraphQLNonNull(GraphQLString),
},
},
resolve: async (parent, args) => await createUser(args),
},
updateUser: {
description: "This type updates a user.",
type: GraphQLNonNull(GraphQLString),
args: {
token: {
type: GraphQLNonNull(GraphQLString),
},
firstName: {
type: GraphQLNonNull(GraphQLString),
},
lastName: {
type: GraphQLNonNull(GraphQLString),
},
goalDailyCalories: {
type: GraphQLNonNull(GraphQLFloat),
},
goalDailyProtein: {
type: GraphQLNonNull(GraphQLFloat),
},
goalDailyCarbohydrates: {
type: GraphQLNonNull(GraphQLFloat),
},
goalDailyFat: {
type: GraphQLNonNull(GraphQLFloat),
},
goalDailyActivity: {
type: GraphQLNonNull(GraphQLFloat),
},
},
resolve: async (parent, args) => updateUser(args),
},
deleteUser: {
description: "This type deletes a user.",
type: GraphQLNonNull(GraphQLString),
args: {
token: {
type: GraphQLNonNull(GraphQLString),
},
},
resolve: async (parent, args) => await deleteUser(args),
},
createActivity: {
description: "This type creates an activity.",
type: GraphQLNonNull(GraphQLString),
args: {
token: {
type: GraphQLNonNull(GraphQLString),
},
name: {
type: GraphQLNonNull(GraphQLString),
},
duration: {
type: GraphQLNonNull(GraphQLFloat),
},
calories: {
type: GraphQLNonNull(GraphQLFloat),
},
},
resolve: async (parent, args) => await createActivity(args),
},
updateActivity: {
description: "This type updates an activity.",
type: GraphQLNonNull(GraphQLString),
args: {
token: {
type: GraphQLNonNull(GraphQLString),
},
activityId: {
type: GraphQLNonNull(GraphQLString),
},
name: {
type: GraphQLNonNull(GraphQLString),
},
duration: {
type: GraphQLNonNull(GraphQLFloat),
},
calories: {
type: GraphQLNonNull(GraphQLFloat),
},
},
resolve: async (parent, args) => updateActivity(args),
},
deleteActivity: {
description: "This type deletes an activity.",
type: GraphQLNonNull(GraphQLString),
args: {
token: {
type: GraphQLNonNull(GraphQLString),
},
activityId: {
type: GraphQLNonNull(GraphQLString),
},
},
resolve: async (parent, args) => await deleteActivity(args),
},
createMeal: {
description: "This type creates a meal.",
type: GraphQLNonNull(GraphQLString),
args: {
token: {
type: GraphQLNonNull(GraphQLString),
},
name: {
type: GraphQLNonNull(GraphQLString),
},
},
resolve: async (parent, args) => await createMeal(args),
},
updateMeal: {
description: "This type updates a meal.",
type: GraphQLNonNull(GraphQLString),
args: {
token: {
type: GraphQLNonNull(GraphQLString),
},
mealId: {
type: GraphQLNonNull(GraphQLString),
},
name: {
type: GraphQLNonNull(GraphQLString),
},
},
resolve: async (parent, args) => updateMeal(args),
},
deleteMeal: {
description: "This type deletes a meal.",
type: GraphQLNonNull(GraphQLString),
args: {
token: {
type: GraphQLNonNull(GraphQLString),
},
mealId: {
type: GraphQLNonNull(GraphQLString),
},
},
resolve: async (parent, args) => await deleteMeal(args),
},
createFood: {
description: "This type creates a food.",
type: GraphQLNonNull(GraphQLString),
args: {
token: {
type: GraphQLNonNull(GraphQLString),
},
mealId: {
type: GraphQLNonNull(GraphQLString),
},
name: {
type: GraphQLNonNull(GraphQLString),
},
calories: {
type: GraphQLNonNull(GraphQLFloat),
},
protein: {
type: GraphQLNonNull(GraphQLFloat),
},
carbohydrates: {
type: GraphQLNonNull(GraphQLFloat),
},
fat: {
type: GraphQLNonNull(GraphQLFloat),
},
},
resolve: async (parent, args) => await createFood(args),
},
updateFood: {
description: "This type updates a food.",
type: GraphQLNonNull(GraphQLString),
args: {
token: {
type: GraphQLNonNull(GraphQLString),
},
mealId: {
type: GraphQLNonNull(GraphQLString),
},
foodId: {
type: GraphQLNonNull(GraphQLString),
},
name: {
type: GraphQLNonNull(GraphQLString),
},
calories: {
type: GraphQLNonNull(GraphQLFloat),
},
protein: {
type: GraphQLNonNull(GraphQLFloat),
},
carbohydrates: {
type: GraphQLNonNull(GraphQLFloat),
},
fat: {
type: GraphQLNonNull(GraphQLFloat),
},
},
resolve: async (parent, args) => updateFood(args),
},
deleteFood: {
description: "This type deletes a food.",
type: GraphQLNonNull(GraphQLString),
args: {
token: {
type: GraphQLNonNull(GraphQLString),
},
mealId: {
type: GraphQLNonNull(GraphQLString),
},
foodId: {
type: GraphQLNonNull(GraphQLString),
},
},
resolve: async (parent, args) => await deleteFood(args),
},
}),
});
module.exports = {
RootMutationType: RootMutationType,
};
|
import { Deferred, when } from '../../core/utils/deferred';
import { isObject, isString } from '../../core/utils/type';
var NEW_SCROLLING_MODE = 'scrolling.newMode';
var needTwoPagesLoading = that => that.option('scrolling.loadTwoPagesOnStart') || that._controller.isVirtual() || that._controller.getViewportItemIndex() > 0;
var getBeginPageIndex = that => {
return that._cache.length ? that._cache[0].pageIndex : -1;
};
var getEndPageIndex = that => {
return that._cache.length ? that._cache[that._cache.length - 1].pageIndex : -1;
};
var fireChanged = (that, changed, args) => {
that._isChangedFiring = true;
changed(args);
that._isChangedFiring = false;
};
var processDelayChanged = (that, changed, args) => {
if (that._isDelayChanged) {
that._isDelayChanged = false;
fireChanged(that, changed, args);
return true;
}
};
var getViewportPageCount = that => {
var pageSize = that._dataOptions.pageSize();
var preventPreload = that.option('scrolling.preventPreload');
if (preventPreload) {
return 0;
}
var realViewportSize = that._controller.viewportSize();
if (that._controller.isVirtualMode() && that.option('scrolling.removeInvisiblePages')) {
realViewportSize = 0;
var viewportSize = that._controller.viewportSize() * that._controller.viewportItemSize();
var offset = that._controller.getContentOffset();
var position = that._controller.getViewportPosition();
var virtualItemsCount = that._controller.virtualItemsCount();
var totalItemsCount = that._dataOptions.totalItemsCount();
for (var itemIndex = virtualItemsCount.begin; itemIndex < totalItemsCount; itemIndex++) {
if (offset >= position + viewportSize) break;
var itemSize = that._controller.getItemSizes()[itemIndex] || that._controller.viewportItemSize();
offset += itemSize;
if (offset >= position) {
realViewportSize++;
}
}
}
return pageSize && realViewportSize > 0 ? Math.ceil(realViewportSize / pageSize) : 1;
};
var getPreloadPageCount = (that, previous) => {
var preloadEnabled = that.option('scrolling.preloadEnabled');
var pageCount = getViewportPageCount(that);
var isAppendMode = that._controller.isAppendMode();
if (pageCount) {
if (previous) {
pageCount = preloadEnabled ? 1 : 0;
} else {
if (preloadEnabled) {
pageCount++;
}
if (isAppendMode || !needTwoPagesLoading(that)) {
pageCount--;
}
}
}
return pageCount;
};
var getPageIndexForLoad = that => {
var result = -1;
var beginPageIndex = getBeginPageIndex(that);
var dataOptions = that._dataOptions;
if (beginPageIndex < 0) {
result = that._pageIndex;
} else if (!that._cache[that._pageIndex - beginPageIndex]) {
result = that._pageIndex;
} else if (beginPageIndex >= 0 && that._controller.viewportSize() >= 0) {
if (beginPageIndex > 0) {
var needToLoadPageBeforeLast = getEndPageIndex(that) + 1 === dataOptions.pageCount() && that._cache.length < getPreloadPageCount(that) + 1;
var needToLoadPrevPage = needToLoadPageBeforeLast || that._pageIndex === beginPageIndex && getPreloadPageCount(that, true);
if (needToLoadPrevPage) {
result = beginPageIndex - 1;
}
}
if (result < 0) {
var needToLoadNextPage = beginPageIndex + that._cache.length <= that._pageIndex + getPreloadPageCount(that);
if (needToLoadNextPage) {
result = beginPageIndex + that._cache.length;
}
}
}
if (that._loadingPageIndexes[result]) {
result = -1;
}
return result;
};
var loadCore = (that, pageIndex) => {
var dataOptions = that._dataOptions;
if (pageIndex === that.pageIndex() || !dataOptions.isLoading() && pageIndex < dataOptions.pageCount() || !dataOptions.hasKnownLastPage() && pageIndex === dataOptions.pageCount()) {
dataOptions.pageIndex(pageIndex);
that._loadingPageIndexes[pageIndex] = true;
return when(dataOptions.load()).always(() => {
that._loadingPageIndexes[pageIndex] = false;
});
}
};
var processChanged = (that, changed, changeType, isDelayChanged, removeCacheItem) => {
var dataOptions = that._dataOptions;
var items = dataOptions.items().slice();
var change = isObject(changeType) ? changeType : undefined;
var isPrepend = changeType === 'prepend';
var viewportItems = dataOptions.viewportItems();
if (changeType && isString(changeType) && !that._isDelayChanged) {
change = {
changeType: changeType,
items: items
};
if (removeCacheItem) {
change.removeCount = removeCacheItem.itemsCount;
if (change.removeCount && dataOptions.correctCount) {
change.removeCount = dataOptions.correctCount(viewportItems, change.removeCount, isPrepend);
}
}
}
var removeItemCount = removeCacheItem ? removeCacheItem.itemsLength : 0;
if (removeItemCount && dataOptions.correctCount) {
removeItemCount = dataOptions.correctCount(viewportItems, removeItemCount, isPrepend);
}
if (changeType === 'append') {
viewportItems.push.apply(viewportItems, items);
if (removeCacheItem) {
viewportItems.splice(0, removeItemCount);
}
} else if (isPrepend) {
viewportItems.unshift.apply(viewportItems, items);
if (removeCacheItem) {
viewportItems.splice(-removeItemCount);
}
} else {
that._dataOptions.viewportItems(items);
}
dataOptions.updateLoading();
that._lastPageIndex = that.pageIndex();
that._isDelayChanged = isDelayChanged;
if (!isDelayChanged) {
fireChanged(that, changed, change);
}
};
export class VirtualDataLoader {
constructor(controller, dataOptions) {
this._controller = controller;
this._dataOptions = dataOptions;
this._pageIndex = this._lastPageIndex = dataOptions.pageIndex();
this._cache = [];
this._loadingPageIndexes = {};
}
option() {
return this._controller.option.apply(this._controller, arguments);
}
viewportItemIndexChanged(itemIndex) {
var pageSize = this._dataOptions.pageSize();
var pageCount = this._dataOptions.pageCount();
var virtualMode = this._controller.isVirtualMode();
var appendMode = this._controller.isAppendMode();
var totalItemsCount = this._dataOptions.totalItemsCount();
var newPageIndex;
if (pageSize && (virtualMode || appendMode) && totalItemsCount >= 0) {
var viewportSize = this._controller.viewportSize();
if (viewportSize && itemIndex + viewportSize >= totalItemsCount && !this._controller.isVirtual()) {
if (this._dataOptions.hasKnownLastPage()) {
newPageIndex = pageCount - 1;
var lastPageSize = totalItemsCount % pageSize;
if (newPageIndex > 0 && lastPageSize > 0 && lastPageSize < viewportSize) {
newPageIndex--;
}
} else {
newPageIndex = pageCount;
}
} else {
newPageIndex = Math.floor(itemIndex / pageSize);
var maxPageIndex = pageCount - 1;
newPageIndex = Math.max(newPageIndex, 0);
newPageIndex = Math.min(newPageIndex, maxPageIndex);
}
this.pageIndex(newPageIndex);
return this.load();
}
}
pageIndex(pageIndex) {
var isVirtualMode = this._controller.isVirtualMode();
var isAppendMode = this._controller.isAppendMode();
if (!this.option(NEW_SCROLLING_MODE) && (isVirtualMode || isAppendMode)) {
if (pageIndex !== undefined) {
this._pageIndex = pageIndex;
}
return this._pageIndex;
} else {
return this._dataOptions.pageIndex(pageIndex);
}
}
beginPageIndex(defaultPageIndex) {
var beginPageIndex = getBeginPageIndex(this);
if (beginPageIndex < 0) {
beginPageIndex = defaultPageIndex !== undefined ? defaultPageIndex : this.pageIndex();
}
return beginPageIndex;
}
endPageIndex() {
var endPageIndex = getEndPageIndex(this);
return endPageIndex > 0 ? endPageIndex : this._lastPageIndex;
}
pageSize() {
return this._dataOptions.pageSize();
}
load() {
var dataOptions = this._dataOptions;
var result;
var isVirtualMode = this._controller.isVirtualMode();
var isAppendMode = this._controller.isAppendMode();
if (!this.option(NEW_SCROLLING_MODE) && (isVirtualMode || isAppendMode)) {
var pageIndexForLoad = getPageIndexForLoad(this);
if (pageIndexForLoad >= 0) {
var loadResult = loadCore(this, pageIndexForLoad);
if (loadResult) {
result = new Deferred();
loadResult.done(() => {
var delayDeferred = this._delayDeferred;
if (delayDeferred) {
delayDeferred.done(result.resolve).fail(result.reject);
} else {
result.resolve();
}
}).fail(result.reject);
dataOptions.updateLoading();
}
}
} else {
result = dataOptions.load();
}
if (!result && this._lastPageIndex !== this.pageIndex()) {
this._dataOptions.onChanged({
changeType: 'pageIndex'
});
}
return result || new Deferred().resolve();
}
loadIfNeed() {
var isVirtualMode = this._controller.isVirtualMode();
var isAppendMode = this._controller.isAppendMode();
if ((isVirtualMode || isAppendMode) && !this._dataOptions.isLoading() && (!this._isChangedFiring || this._controller.isVirtual())) {
var position = this._controller.getViewportPosition();
if (position > 0) {
this._controller._setViewportPositionCore(position);
} else {
this.load();
}
}
}
handleDataChanged(callBase, e) {
var dataOptions = this._dataOptions;
var lastCacheLength = this._cache.length;
var changeType;
var removeInvisiblePages;
var isVirtualMode = this._controller.isVirtualMode();
var isAppendMode = this._controller.isAppendMode();
if (e && e.changes) {
fireChanged(this, callBase, e);
} else if (!this.option(NEW_SCROLLING_MODE) && (isVirtualMode || isAppendMode)) {
var beginPageIndex = getBeginPageIndex(this);
if (beginPageIndex >= 0) {
if (isVirtualMode && beginPageIndex + this._cache.length !== dataOptions.pageIndex() && beginPageIndex - 1 !== dataOptions.pageIndex()) {
lastCacheLength = 0;
this._cache = [];
}
if (isAppendMode) {
if (dataOptions.pageIndex() === 0) {
this._cache = [];
} else if (dataOptions.pageIndex() < getEndPageIndex(this)) {
fireChanged(this, callBase, {
changeType: 'append',
items: []
});
return;
}
}
}
var cacheItem = {
pageIndex: dataOptions.pageIndex(),
itemsLength: dataOptions.items(true).length,
itemsCount: this.itemsCount(true)
};
if (this.option('scrolling.removeInvisiblePages') && isVirtualMode) {
removeInvisiblePages = this._cache.length > Math.max(getPreloadPageCount(this) + (this.option('scrolling.preloadEnabled') ? 1 : 0), 2);
} else {
processDelayChanged(this, callBase, {
isDelayed: true
});
}
var removeCacheItem;
if (beginPageIndex === dataOptions.pageIndex() + 1) {
if (removeInvisiblePages) {
removeCacheItem = this._cache.pop();
}
changeType = 'prepend';
this._cache.unshift(cacheItem);
} else {
if (removeInvisiblePages) {
removeCacheItem = this._cache.shift();
}
changeType = 'append';
this._cache.push(cacheItem);
}
var isDelayChanged = isVirtualMode && lastCacheLength === 0 && needTwoPagesLoading(this);
processChanged(this, callBase, this._cache.length > 1 ? changeType : undefined, isDelayChanged, removeCacheItem);
this._delayDeferred = this.load().done(() => {
if (processDelayChanged(this, callBase)) {
this.load(); // needed for infinite scrolling when height is not defined
}
});
} else {
processChanged(this, callBase, e);
}
}
getDelayDeferred() {
return this._delayDeferred;
}
itemsCount(isBase) {
var itemsCount = 0;
var isVirtualMode = this._controller.isVirtualMode();
if (!isBase && isVirtualMode) {
this._cache.forEach(cacheItem => {
itemsCount += cacheItem.itemsCount;
});
} else {
itemsCount = this._dataOptions.itemsCount();
}
return itemsCount;
}
virtualItemsCount() {
var pageIndex = getBeginPageIndex(this);
if (pageIndex < 0) {
pageIndex = this._dataOptions.pageIndex();
}
var beginItemsCount = pageIndex * this._dataOptions.pageSize();
var itemsCount = this._cache.length * this._dataOptions.pageSize();
var endItemsCount = Math.max(0, this._dataOptions.totalItemsCount() - itemsCount - beginItemsCount);
return {
begin: beginItemsCount,
end: endItemsCount
};
}
reset() {
this._loadingPageIndexes = {};
this._cache = [];
}
}
|
import React from 'react';
function Showcase({selectedMain}){
return(
<div className="showcase">
<div className="main">
<img src ={`/img/banner/${selectedMain}/1.jpg`} alt="showcase" />
</div>
<div className="sub1">
<img src ={`/img/banner/${selectedMain}/2.jpg`} alt="showcase" />
</div>
<div className="sub2">
<img src ={`/img/banner/${selectedMain}/3.jpg`} alt="showcase" />
</div>
<div className="sub3">
<img src ={`/img/banner/${selectedMain}/4.jpg`} alt="showcase" />
</div>
<div className="sub4">
<img src ={`/img/banner/${selectedMain}/5.jpg`} alt="showcase" />
</div>
</div>
)
}
export default Showcase;
|
import React, { useState,useEffect, useRef } from "react";
import { Form, Input, InputNumber,Upload, Modal, Button, Select } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import axios from "axios";
const { Option } = Select;
function getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
class PicturesWall extends React.Component {
constructor(props){
super(props);
console.log(this.props.imgProduct);
this.state = {
previewVisible: false,
previewImage: '',
previewTitle: '',
fileList: this.props.imgProduct,
files: [],
};
}
// componentDidMount= () => {
// this.setState({fileList : this.props.imgProduct})
// }
handleCancel = () => this.setState({ previewVisible: false });
handlePreview = async file => {
console.log("preview");
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj);
}
this.setState({
previewImage: file.url || file.preview,
previewVisible: true,
previewTitle: file.name || file.url.substring(file.url.lastIndexOf('/') + 1),
});
};
handleChange = ({file, fileList }) => {
const fieldValue = this.props.form.getFieldValue();
this.props.form.setFieldsValue({...fieldValue, images: fileList });
this.setState({ fileList });
}
render() {
const { previewVisible, previewImage, fileList, previewTitle } = this.state;
const uploadButton = (
<div>
<PlusOutlined />
<div style={{ marginTop: 8 }}>Upload</div>
</div>
);
return (
<>
<Upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
listType="picture-card"
fileList={fileList}
onPreview={this.handlePreview}
onChange={this.handleChange}
>
{fileList.length >= 8 ? null : uploadButton}
</Upload>
<Modal
visible={previewVisible}
title={previewTitle}
footer={null}
onCancel={this.handleCancel}
>
<img alt="example" style={{ width: '100%' }} src={previewImage} />
</Modal>
</>
);
}
}
const layout = {
labelCol: {
span: 4,
},
wrapperCol: {
span: 16,
},
};
const validateMessages = {
required: '${label} is required!',
types: {
email: '${label} is not a valid email!',
number: '${label} is not a valid number!',
},
number: {
range: '${label} must be between ${min} and ${max}',
},
};
const FormEdit = ({categorys, onLoad,close, dataFormEdit, add }) => {
const [form] = Form.useForm();
let lsimg = [];
if(dataFormEdit && dataFormEdit.link_img){
lsimg = dataFormEdit.link_img.map((img, index) => ({uid : index*-1, name: 'image.jpg', status: 'done', url: img}));
}
form.setFieldsValue(dataFormEdit);
const onFinish = (values) => {
console.log(values);
};
const onChangeCategory = (value) => {
console.log(value);
form.setFieldsValue({...form.getFieldValue().product, category_id: value});
};
return (
<Form {...layout} name="nest-messages" form={form} onFinish={onFinish} validateMessages={validateMessages}>
<Form.Item
name='name'
label="Product Name"
rules={[
{
required: true,
},
]}
>
<Input />
</Form.Item>
<Form.Item
name='quantityInStock'
label="Quantity in Stock"
rules={[
{
type: 'number',
min: 0,
max: 50000,
},
]}
>
<InputNumber />
</Form.Item>
<Form.Item
name='price'
label="Price"
rules={[
{
type: 'number',
min: 0,
max: 50000,
},
]}
>
<InputNumber />
</Form.Item>
<Form.Item
name= 'sendFrom'
label="Send From"
>
<Input />
</Form.Item>
<Form.Item
name='trademark'
label="Trademark"
>
<Input />
</Form.Item>
<Form.Item
name='category_id'
label="Category"
rules={[
{
required: true,
},
]}
>
<Select
placeholder="Select a option category"
onChange={onChangeCategory}
>
{
categorys.map(category => <Option value={category.id}>{category.name}</Option>)
}
</Select>
</Form.Item>
<Form.Item name='origin' label="Origin">
<Input />
</Form.Item>
<Form.Item name='description' label="Description">
<Input.TextArea />
</Form.Item>
<Form.Item name='images' label="Ảnh sản phẩm">
<PicturesWall form={form} imgProduct={lsimg} />
</Form.Item>
<Form.Item>
<Button type="primary" style={{marginLeft: "160px"}}
//htmlType="submit"
onClick={() => {
//console.log(res.current.files);
console.log(form.getFieldValue())
let object = form.getFieldValue();
let formData = new FormData();
console.log(form.getFieldValue());
Object.keys(object).forEach(key => {
console.log(key);
console.log(object[key]);
if(key != 'images')
formData.append(`product[${key}]`, object[key])
});
console.log(formData);
if(add){
object.images.map(img => {
console.log(img)
formData.append(`product[images][]`, img.originFileObj)
});
axios({
method: 'post',
url:'http://localhost:3000/api/products',
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
'Authorization': 'Bearer ' + localStorage.getItem("token")
}
}).then(res => {
console.log(res.data);
close();
onLoad();
});
} else {
axios({
method: 'PUT',
url: `http://localhost:3000/api/products/${object.id}`,
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
'Authorization': 'Bearer ' + localStorage.getItem("token")
}
}).then(res => {
console.log(res.data);
close();
onLoad();
})
}
}}
>
Submit
</Button>
<Button style={{marginLeft: "100px"}} onClick={()=> close()}>Cancel</Button>
</Form.Item>
</Form>
);
};
export default FormEdit;
|
import { StyleSheet, Dimensions, Platform } from 'react-native';
const window = Dimensions.get('window');
import Constants from 'expo-constants';
import colors from '../../assets/colors';
import theme from '../../assets/theme'
export default styles = StyleSheet.create({
container: {
flex: 1,
},
navBar: {
flexDirection : 'row',
// paddingTop : (Platform.OS === "ios") ? 16 : 14,
height : (Platform.OS === "ios") ? 50 : 60,
backgroundColor: theme.toolBarColor,
width: '100%',
alignItems: 'center',
paddingBottom: 4
},
headerIcon: {
height: 16,
width: 16,
},
headerImage: {
borderRadius: 30,
height: 40,
width: 40,
backgroundColor: 'transparent',
justifyContent: 'center',
alignItems: 'center',
},
balanceTxtView: {
flexDirection: 'row',
justifyContent: 'flex-start',
width: '50%'
},
nameView: {
flexDirection: 'row',
width: '50%',
},
txtHeader: {
fontSize: 18,
color: colors.white,
marginLeft: 8,
alignSelf: 'center',
fontFamily : 'Roboto-Regular'
},
cards : {
shadowColor: colors.gray,
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.5,
shadowRadius: 2,
elevation: 1,
height: 50,
width : '90%',
marginVertical : 30,
backgroundColor : theme.inputFieldBg,
borderRadius : 4,
flexDirection : 'row',
alignSelf : "center"
},
cardImageView : {
width : '15%',
height : '100%',
backgroundColor : colors.white,
borderTopLeftRadius : 4,
borderBottomLeftRadius : 4,
justifyContent: 'center',
alignItems: 'center',
},
cardIcon : {
height : 20,
width : 20,
resizeMode : 'contain',
tintColor : theme.primaryColor,
},
viewText : {
paddingLeft : 24,
width : '70%',
height : '100%',
justifyContent: 'center',
},
amtText : {
fontSize: 16,
color: theme.primaryTextColor,
fontFamily: 'Roboto-Regular',
},
angleView : {
width : '15%',
borderTopRightRadius : 4,
borderBottomRightRadius : 4,
justifyContent: 'center',
alignItems: 'center',
},
angleBack : {
width : 12,
height : 12,
tintColor : theme.primaryColor,
},
wrapper: {
flex: 1,
paddingLeft: 20,
paddingRight: 20,
marginTop: 20,
width : '100%',
},
formView: {
flexDirection: 'column',
width : '100%',
paddingTop : 4
},
formHeaderTxt: {
fontSize: 16,
color: colors.darkSilver,
fontFamily: 'Roboto-Light',
},
formstyle : {
backgroundColor : colors.field_color,
},
textBtn: {
fontSize: 16,
color: colors.whiteShade,
fontFamily: 'Roboto-Regular',
},
signupLinkView: {
justifyContent: 'center',
flexDirection: 'column',
marginTop : 16,
},
signupText: {
fontSize: 18,
color: colors.button_border,
// marginTop: 8,
fontFamily: 'Roboto-Regular',
alignSelf: 'center',
},
btnView: {
// backgroundColor : colors.background_color,
alignItems : 'center',
width : '100%',
paddingBottom : 15
},
buttonBorder: {
alignItems: 'center',
justifyContent: 'center',
width: '20%',
height: 40,
backgroundColor: colors.white,
borderRadius : 25,
},
btnStyle : {
backgroundColor : theme.primaryColor,
width : '50%',
justifyContent: 'center',
alignItems : 'center',
height : 40,
borderRadius : 30,
marginTop: 16,
},
btnText : {
fontSize: 18,
color: colors.white,
fontFamily: 'Roboto-Regular',
alignSelf: 'center',
},
});
|
import React, { Component } from "react";
class JokeList extends Component {
static defaultProps = {
numJokesToGet: 10,
};
componentDidMount() {}
render() {
return <h1>JokeList!</h1>;
}
}
export default JokeList;
|
function getWindowsTopAndLeftScreen(){
var leftPos = (typeof window.screenLeft == 'number')?window.screenLeft:window.screenX;
var topPos = (typeof window.screenTop == 'number')? window.screenTop:window.screenTop;
console.log('leftPos:'+leftPos);
console.log('topPos:'+topPos);
}
getWindowsTopAndLeftScreen();
|
import mongoose from "mongoose";
const SurveySchema = new mongoose.Schema({
patient: { type: String, required: true },
date: { type: Date, required: false },
answers: { type: String, required: true },
modality: { type: String, required: true },
other: { type: String, required: false },
completed: { type: Boolean, required: true },
});
export default mongoose.model("Surveys", SurveySchema);
|
APP.controller('propertyController', function ($http) {
this.property = {};
this.init = function (data) {
this.uniqueId = data.uniqueId;
that = this;
$http.get('/property/getProperty/' + this.uniqueId , { params: { uniqueId: this.uniqueId } }).then(function (response) {
that.property = response.data;
});
}
this.init = function (uniqueId) {
this.uniqueId = uniqueId;
that = this;
$http.get('/property/getProperty/' + this.uniqueId , { params: { uniqueId: this.uniqueId } }).then(function (response) {
that.property = response.data;
});
}
});
|
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
WebView,
TouchableOpacity
} from 'react-native';
//获得webView所需要的数据
var URL = 'https://www.baidu.com';
var BusinessNav = require('./businessNav.js');
var Business = React.createClass({
render:function(){
return (
<View>
{/*导航条部分*/}
{this.renderNav()}
{/*webView主体部分*/}
<WebView
source={{uri: URL}}
javaScriptEnabled={true}
domStorageEnabled={true}
decelerationRate="normal"
startInLoadingState={true}
/>
</View>
);
},
renderNav:function(){
return (
<BusinessNav txt={"商家"} />
);
}
});
module.exports = Business;
|
/**
* Controller for the Sharingear gear booking page view.
* @author: Chris Hjorth
*/
/*jslint node: true */
'use strict';
var $ = require('jquery'),
Moment = require('moment-timezone'),
Config = require('../config.js'),
ViewController = require('../viewcontroller.js'),
App = require('../app.js'),
Localization = require('../models/localization.js'),
Booking = require('../models/booking.js'),
SelectTimePopup = require('../popups/selecttime.js');
function BookingRequest(options) {
ViewController.call(this, options);
}
BookingRequest.prototype = new ViewController();
BookingRequest.prototype.didInitialize = function() {
var view = this;
Moment.locale('en-custom', {
week: {
dow: 1,
doy: 4
}
});
this.owner = this.passedData.owner;
this.bookingBtnEnabled = false;
view.templateParameters = {
item_name: this.passedData.item_name,
currency: App.user.data.currency
};
if (this.passedData.booking) {
this.newBooking = this.passedData.booking;
} else {
this.newBooking = new Booking({
rootURL: Config.API_URL
});
this.newBooking.initialize();
this.newBooking.data.gear_id = this.passedData.gear_id;
this.newBooking.data.van_id = this.passedData.van_id;
this.newBooking.data.techprofile_id = this.passedData.techprofile_id;
this.newBooking.data.item_name = this.passedData.item_name;
this.newBooking.data.price_a = this.passedData.price_a;
this.newBooking.data.price_b = this.passedData.price_b;
this.newBooking.data.price_c = this.passedData.price_c;
this.newBooking.data.currency = this.passedData.currency;
}
this.setTitle('Sharingear - Booking request');
this.setDescription('Book your gear for the time you need it, just select pickup and delivery dates and times in the calendar.');
};
BookingRequest.prototype.didRender = function() {
this.renderPricing();
this.calculatePrice();
this.renderCalendar();
this.setupEvent('click', '#bookingrequest-cancel-btn', this, this.handleCancel);
this.setupEvent('click', '#bookingrequest-next', this, this.handleNext);
window.mixpanel.track('View bookingrequest');
};
BookingRequest.prototype.renderCalendar = function() {
var view = this,
$calendarContainer, passedData, CalendarVC, calendarVT;
$calendarContainer = $('.pickupdeliverycalendar-container', view.$element);
passedData = {
availability: view.passedData.availability,
alwaysFlag: view.passedData.alwaysFlag,
parent: view
};
CalendarVC = require('./pickupdeliverycalendar.js');
calendarVT = require('../../templates/pickupdeliverycalendar.html');
view.calendarVC = new CalendarVC({
name: 'pickupdeliverycalendar',
$element: $calendarContainer,
template: calendarVT,
passedData: passedData
});
view.calendarVC.initialize();
view.calendarVC.render();
};
BookingRequest.prototype.renderPricing = function() {
var view = this;
Localization.convertPrices([this.passedData.price_a, this.passedData.price_b, this.passedData.price_c], this.passedData.currency, App.user.data.currency, function(error, convertedPrices) {
if (error) {
console.error('Error converting prices: ' + error);
return;
}
$('.price_a', view.$element).html(Math.ceil(convertedPrices[0]));
$('.price_b', view.$element).html(Math.ceil(convertedPrices[1]));
$('.price_c', view.$element).html(Math.ceil(convertedPrices[2]));
});
};
BookingRequest.prototype.calculatePrice = function() {
var view = this,
startMoment = new Moment.tz(this.newBooking.data.start_time, Localization.getCurrentTimeZone()),
endMoment = new Moment.tz(this.newBooking.data.end_time, Localization.getCurrentTimeZone()),
duration, months, weeks, days, hours;
//Get number of months, get number of weeks from remainder, get number of days from remainder
duration = Moment.duration(endMoment.diff(startMoment));
months = parseInt(duration.months(), 10);
endMoment.subtract(months, 'months');
duration = Moment.duration(endMoment.diff(startMoment));
weeks = parseInt(duration.weeks(), 10);
endMoment.subtract(weeks, 'weeks');
duration = Moment.duration(endMoment.diff(startMoment));
days = parseInt(duration.days(), 10);
endMoment.subtract(days, 'days');
duration = Moment.duration(endMoment.diff(startMoment));
hours = parseInt(duration.hours(),10);
//In case <24 hours are selected the user should pay for one day
//In case 25 hours are selected, the user should pay for two days and so on
//In case 6 days and 1 hour is selected, the user should pay for 1 week and so on
if(hours!==0 && hours%24!==0){
days++;
if (days===7) {
weeks++;
days = 0;
}
if(weeks===4){
months++;
weeks = 0;
}
}
$('#bookingrequest-days', this.$element).html(days);
$('#bookingrequest-weeks', this.$element).html(weeks);
$('#bookingrequest-months', this.$element).html(months);
Localization.convertPrices([this.passedData.price_a, this.passedData.price_b, this.passedData.price_c], this.passedData.currency, App.user.data.currency, function(error, convertedPrices) {
var price;
if (error) {
console.error('Error converting prices: ' + error);
return;
}
price = months * Math.ceil(convertedPrices[2]) + weeks * Math.ceil(convertedPrices[1]) + days * Math.ceil(convertedPrices[0]);
$('#bookingrequest-price', view.$element).html(price);
});
};
BookingRequest.prototype.handleCancel = function() {
App.router.closeModalView();
};
BookingRequest.prototype.handlePickupSelection = function(calendarVC, callback) {
var view = this,
selectTimePopup = new SelectTimePopup();
selectTimePopup.initialize();
selectTimePopup.setTitle('Select pickup time');
selectTimePopup.show();
selectTimePopup.on('close', function(popup) {
if (!popup.getWasClosed()) {
var time = popup.getSelectedTime();
calendarVC.pickupDate.hour(time.hours);
calendarVC.pickupDate.minute(time.minutes);
view.newBooking.data.start_time = new Moment.tz(calendarVC.pickupDate, Localization.getCurrentTimeZone());
view.newBooking.data.end_time = null;
view.calculatePrice();
callback();
}
});
};
BookingRequest.prototype.handleDeliverySelection = function(calendarVC, isTimeSelected, callback) {
var view = this,
selectTimePopup;
if (isTimeSelected === true) {
view.newBooking.data.end_time = new Moment.tz(calendarVC.deliveryDate, Localization.getCurrentTimeZone());
view.calculatePrice();
return;
}
selectTimePopup = new SelectTimePopup();
selectTimePopup.initialize();
selectTimePopup.setTitle('Select delivery time');
selectTimePopup.show();
selectTimePopup.on('close', function(popup) {
if (!popup.getWasClosed()) {
var time = popup.getSelectedTime();
calendarVC.deliveryDate.hour(time.hours);
calendarVC.deliveryDate.minute(time.minutes);
view.newBooking.data.end_time = new Moment.tz(calendarVC.deliveryDate, Localization.getCurrentTimeZone());
view.calculatePrice();
callback();
}
});
};
BookingRequest.prototype.handleNext = function(event) {
var view = event.data,
passedData;
// check if time was selected
if (view.newBooking.data.start_time === null || view.newBooking.data.end_time === null) {
alert('No dates selected.');
return;
}
passedData = {
booking: view.newBooking,
owner: view.owner
};
App.router.openModalSiblingView('payment', passedData);
};
module.exports = BookingRequest;
|
const ganache = require('ganache-cli');
const HDWalletProvider = require('@truffle/hdwallet-provider');
const Web3 = require('web3');
module.exports = () => {
let web3;
if (process.env.NODE_ENV === 'test') {
web3 = new Web3(ganache.provider({ default_balance_ether: 1000 }));
return web3;
} else if (process.env.NODE_ENV === 'development') {
// First component is the mnemonic address
// Second component is link of network we wanna connect to, in this case the Ropsten Test Network, link provided by Infura to ease our effort in setting up our own Ethereum node. The link allows us to connect to a node offered by Infura
const provider = new HDWalletProvider({
mnemonic: { phrase: process.env.MNEMONIC },
providerOrUrl: process.env.INFURA_URL,
});
web3 = new Web3(provider);
return { web3, provider };
}
};
|
import { Component } from 'react';
import styled from 'styled-components';
import { Link } from 'react-router-dom';
import BrandButton from 'components/button/BrandButton';
import LikeButton from 'components/button/LikeButton';
import UnLikeButton from 'components/button/UnLikeButton';
export default class ItemList extends Component {
constructor() {
super();
this.state = {
disLike: false,
};
}
render() {
const { productList, isCheck } = this.props;
console.log(productList);
if (!productList[0]?.product.id) {
return <Null>찾으려는 상품이 존재하지 않습니다.</Null>;
}
return (
<Container>
{productList ? (
<>
{isCheck
? productList
.filter(v => v.product.disLike === false)
.map(v => (
<Item to={`/product/${v.product.id}`} key={v.product.id}>
<Image src={v.product.image} alt="상품이미지" />
<Information>
<Group>
<BrandButton>{v.product.brand}</BrandButton>
{v.product.disLike ? (
<UnLikeButton>관심 없어요</UnLikeButton>
) : (
<LikeButton>관심 있어요</LikeButton>
)}
</Group>
<Title>{v.product.title}</Title>
<Price>
<span>{(v.product.price * 1).toLocaleString()}</span>
원
</Price>
</Information>
</Item>
))
: productList.map(v => {
return (
<Item to={`/product/${v.product.id}`} key={v.product.id}>
<Image src={v.product.image} alt="상품이미지" />
<Information>
<Group>
<BrandButton>{v.product.brand}</BrandButton>
{v.product.disLike ? (
<UnLikeButton>관심 없어요</UnLikeButton>
) : (
<LikeButton>관심 있어요</LikeButton>
)}
</Group>
<Title>{v.product.title}</Title>
<Price>
<span>{(v.product.price * 1).toLocaleString()}</span>
원
</Price>
</Information>
</Item>
);
})}
</>
) : (
<Null>최근 본 상품이 없습니다.</Null>
)}
</Container>
);
}
}
const Container = styled.div``;
const Item = styled(Link)`
display: flex;
flex-direction: row;
padding: 30px 0px;
width: 600px;
border-bottom: 1px solid #dddddd;
button {
height: 38px;
max-width: 140px;
border-radius: 50px;
}
`;
const Image = styled.img`
width: 180px;
border-radius: 5px;
`;
const Group = styled.div`
display: flex;
flex-direction: row;
img {
width: 24px;
margin-right: 5px;
}
div {
font-size: 17px;
}
`;
const Information = styled.div`
margin-left: 30px;
`;
const Title = styled.h2`
max-width: 350px;
margin-top: 20px;
font-size: 21px;
font-weight: 500;
line-height: 1.5;
word-break: keep-all;
color: #111213;
`;
const Price = styled.div`
margin-top: 15px;
font-size: 24px;
font-weight: 500;
color: #111213;
span {
margin-right: 3px;
font-size: 28px;
font-weight: 600;
}
`;
const Null = styled.div`
margin-top: 250px;
font-size: 20px;
color: #73737f;
`;
|
const express=require('express')
const fs=require('fs')
const dotenv=require('dotenv')
const morgan=require('morgan')
const exphbs=require('express-handlebars')
const connectDB=require('./config/db')
const path=require('path')
const session=require('express-session')
const passport=require('passport')
const mongoose=require('mongoose')
const MongoStore=require('connect-mongo')(session)
const methodOverride=require('method-override')
let https=true
//Load config
dotenv.config({path: './config/config.env'})
//Passport
require('./config/passport')(passport)
connectDB()
//Creating Http server
let server
const app=express()
const http=require('http').createServer(app)
//Load certificate and private key
if(process.env.HTTPS_ENABLED==="1"){
try {
const key=fs.readFileSync('private.key')
const cert=fs.readFileSync('certificate.crt')
//Creating Https server
server=require('https').createServer({key: key, cert: cert}, app)
} catch (err) {
console.error("Can\'t find certicifate files")
process.exit(1)
}
}
//Body parser
app.use(express.urlencoded({extended: false}))
app.use(express.json())
//Method override
app.use(methodOverride((req, res)=>{
if(req.body&&typeof req.body==="object"&&'_method' in req.body){
let method=req.body._method
delete req.body._method
return method
}
}))
if(process.env.NODE_ENV==='development'){
app.use(morgan('dev'))
}
//Handlebars Helpers
const {formatDate, stripTags, truncate, editIcon, select}=require('./helpers/hbs')
//Handlebars
app.engine('.hbs', exphbs({helpers: {
formatDate,
stripTags,
truncate,
editIcon,
select
},defaultLayout: 'main', extname: '.hbs'}))
app.set('view engine', '.hbs')
app.use(express.static(path.join(__dirname, 'public')))
//Session
app.use(session({
secret: 'sbooks',
resave: false,
saveUninitialized: false,
store: new MongoStore({mongooseConnection: mongoose.connection})
}))
//Passport middleware
app.use(passport.initialize())
app.use(passport.session())
//Set global var
app.use((req, res, next)=>{
res.locals.user=req.user || null
next()
})
//Routes
app.use('/', require('./routes/index'))
app.use('/auth', require('./routes/auth'))
app.use('/stories', require('./routes/stories'))
app.use((req, res, next)=>{
res.status(404).render('error/404')
})
const PORT=process.env.PORT || 5000
http.listen(80, console.log(`Server running in ${process.env.NODE_ENV} mode on port ${process.env.HTTP}`))
if(process.env.HTTPS_ENABLED==="1"){
server.listen(PORT, console.log(`Server running in ${process.env.NODE_ENV} mode on port ${PORT}`))
}
|
import rotate from './solution.js';
const body = document.querySelector('body');
const startButton = document.querySelector('button');
const main = document.querySelector('main');
const passed = document.createElement('h2');
const failed = document.createElement('h2');
passed.classList.add('smooth-transition');
failed.classList.add('smooth-transition');
main.append(passed);
main.append(failed);
let counter = 0;
const results = {
passed: 0,
failed: 0
}
const testCases = [
[
[1, 2, 3, 4, 5, 6, 7], 3, [5, 6, 7, 1, 2, 3, 4]
],
[
[-1, -100, 3, 99], 2, [3, 99, -1, -100]
],
[
[1, 2, 3, 4], 0, [1, 2, 3, 4],
],
[
[10, 20, 15, 25, 30, 20], 4, [15, 25, 30, 20, 10, 20]
],
[
[99, 99, 99], 1, [99, 99, 99]
],
[
[5, 4, 3, 2, 1], 5, [5, 4, 3, 2, 1]
],
[
[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200], 10, [110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
],
[
[1, 2, 3], 1, [3, 1, 2]
],
[
[5, 4, 3, 2, 1], 3, [3, 2, 1, 5, 4]
],
[
[1, 1, 1, 1, 1, 1, 1, 1, 2], 6, [1, 1, 1, 1, 1, 2, 1, 1, 1]
]
];
const buildErrorSentence = (testCase, result, itemCount) => {
const containingDiv = document.createElement('div');
const mainHeading = document.createElement('h3');
const testCasePTag = document.createElement('p');
const expectedResult = document.createElement('p');
const output = document.createElement('p');
mainHeading.innerText = `Failed Test Case ${itemCount + 1}`;
testCasePTag.innerText = `Input: nums = [${testCase[0]}], k = ${testCase[1]}`;
expectedResult.innerText = `Expected: [${testCase[2]}]`;
output.innerText = `Output: [${result}]`;
containingDiv.append(mainHeading, testCasePTag, expectedResult, output);
containingDiv.classList.add('error-box')
main.append(containingDiv);
}
startButton.addEventListener('click', () => {
const delayTest = setInterval(() => {
if (counter < testCases.length) {
const result = rotate(testCases[counter][0], testCases[counter][1]);
if (result.toString() === testCases[counter][2].toString()) {
if (!body.classList.contains('all-good') && !body.classList.contains('errors')) {
body.classList.add('all-good');
}
results.passed++;
} else {
if (!body.classList.contains('errors')) {
if (body.classList.contains('all-good')) {
body.classList.remove('all-good');
}
body.classList.add('errors');
}
results.failed++;
buildErrorSentence(testCases[counter], result, counter)
}
counter++;
} else {
clearInterval(delayTest);
}
passed.innerText = `${results.passed} ${results.passed === 1 ? 'Test' : 'Tests'} Passed`;
failed.innerText = `${results.failed} ${results.failed === 1 ? 'Test' : 'Tests'} Failed`;
}, 50);
});
|
import React from "react"
import {
View,
Image,
ImageBackground,
TouchableOpacity,
Text,
Button,
Switch,
TextInput,
StyleSheet,
ScrollView
} from "react-native"
import Icon from "react-native-vector-icons/FontAwesome"
import { CheckBox } from "react-native-elements"
import { connect } from "react-redux"
import {
widthPercentageToDP as wp,
heightPercentageToDP as hp
} from "react-native-responsive-screen"
import { getNavigationScreen } from "@screens"
export class Blank extends React.Component {
constructor(props) {
super(props)
this.state = {}
}
render = () => (
<ScrollView
contentContainerStyle={{ flexGrow: 1 }}
style={styles.ScrollView_1}
>
<View style={styles.View_2} />
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/eedd/3c6f/42903ce9627c601e753f8a5b977afe3a"
}}
style={styles.ImageBackground_374_30}
/>
<View style={styles.View_374_34}>
<View style={styles.View_374_35}>
<Text style={styles.Text_374_35}>Planning ahead</Text>
</View>
<View style={styles.View_374_36}>
<Text style={styles.Text_374_36}>
Setup your budget for each category so you in control
</Text>
</View>
</View>
<View style={styles.View_816_214}>
<View style={styles.View_I816_214_568_4137}>
<Text style={styles.Text_I816_214_568_4137}>Sign Up</Text>
</View>
</View>
<View style={styles.View_816_215}>
<View style={styles.View_I816_215_568_4847}>
<Text style={styles.Text_I816_215_568_4847}>Login</Text>
</View>
</View>
<View style={styles.View_816_818}>
<View style={styles.View_I816_818_816_137}>
<View style={styles.View_I816_818_816_138}>
<Text style={styles.Text_I816_818_816_138}>9:41</Text>
</View>
</View>
<View style={styles.View_I816_818_816_139}>
<View style={styles.View_I816_818_816_140}>
<View style={styles.View_I816_818_816_141}>
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/42fe/75df/eee86effef9007e53d20453d65f0d730"
}}
style={styles.ImageBackground_I816_818_816_142}
/>
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/323b/7a56/3bd8d761d4d553ed17394f5c34643bfe"
}}
style={styles.ImageBackground_I816_818_816_145}
/>
</View>
<View style={styles.View_I816_818_816_146} />
</View>
<View style={styles.View_I816_818_816_147}>
<View style={styles.View_I816_818_816_148} />
<View style={styles.View_I816_818_816_149} />
<View style={styles.View_I816_818_816_150} />
<View style={styles.View_I816_818_816_151} />
</View>
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/6a2b/c9ca/21b52f3f9fca9a68ca91e9ed4afad110"
}}
style={styles.ImageBackground_I816_818_816_152}
/>
</View>
</View>
<View style={styles.View_1271_5695}>
<View style={styles.View_I1271_5695_1271_5631} />
<View style={styles.View_I1271_5695_1271_5592}>
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/bee8/6255/6b7bea1937fe159cddc866c6a4798ab5"
}}
style={styles.ImageBackground_I1271_5695_1271_5593}
/>
<View style={styles.View_I1271_5695_1271_5594}>
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/3acf/f338/b576805e720ecaacc4717f07e1eec9a3"
}}
style={styles.ImageBackground_I1271_5695_1271_5595}
/>
<View style={styles.View_I1271_5695_1271_5596}>
<View style={styles.View_I1271_5695_1271_5597}>
<View style={styles.View_I1271_5695_1271_5598}>
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/f6a5/f1d9/78d552e8da61554d147370abb48da77c"
}}
style={styles.ImageBackground_I1271_5695_1271_5599}
/>
<View style={styles.View_I1271_5695_1271_5600}>
<View style={styles.View_I1271_5695_1271_5601} />
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/1292/9085/c36ab50e41f84768af05120212dc5d95"
}}
style={styles.ImageBackground_I1271_5695_1271_5602}
/>
</View>
</View>
<View style={styles.View_I1271_5695_1271_5603}>
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/f34b/d0f6/107ab42e26ecb39fee1e0389aa41c3c8"
}}
style={styles.ImageBackground_I1271_5695_1271_5604}
/>
<View style={styles.View_I1271_5695_1271_5605}>
<View style={styles.View_I1271_5695_1271_5606} />
</View>
</View>
<View style={styles.View_I1271_5695_1271_5607}>
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/76b6/98e9/7027e0e9c30ab809d0ff8614c19c7b57"
}}
style={styles.ImageBackground_I1271_5695_1271_5608}
/>
<View style={styles.View_I1271_5695_1271_5609}>
<View style={styles.View_I1271_5695_1271_5610} />
</View>
</View>
</View>
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/4594/378b/d15925b2a00c06a2b50b70630df5989d"
}}
style={styles.ImageBackground_I1271_5695_1271_5611}
/>
</View>
</View>
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/ffef/62be/8ae9a8723bcd4df26fd215a6282545fb"
}}
style={styles.ImageBackground_I1271_5695_1271_5612}
/>
</View>
</View>
<View style={styles.View_816_224}>
<View style={styles.View_I816_224_217_6977} />
</View>
</ScrollView>
)
}
const styles = StyleSheet.create({
ScrollView_1: { backgroundColor: "rgba(255, 255, 255, 1)" },
View_2: { height: hp("111%") },
ImageBackground_374_30: {
width: wp("17%"),
minWidth: wp("17%"),
height: hp("2%"),
minHeight: hp("2%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("41%"),
top: hp("81%")
},
View_374_34: {
width: wp("75%"),
minWidth: wp("75%"),
height: hp("13%"),
minHeight: hp("13%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("12%"),
top: hp("61%")
},
View_374_35: {
width: wp("64%"),
minWidth: wp("64%"),
minHeight: hp("5%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("6%"),
top: hp("0%"),
justifyContent: "flex-start"
},
Text_374_35: {
color: "rgba(33, 35, 37, 1)",
fontSize: 26,
fontWeight: "700",
textAlign: "center",
fontStyle: "normal",
letterSpacing: 0,
textTransform: "none"
},
View_374_36: {
width: wp("75%"),
minWidth: wp("75%"),
minHeight: hp("5%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
top: hp("8%"),
justifyContent: "flex-start"
},
Text_374_36: {
color: "rgba(145, 145, 159, 1)",
fontSize: 13,
fontWeight: "500",
textAlign: "center",
fontStyle: "normal",
letterSpacing: 0,
textTransform: "none"
},
View_816_214: {
width: wp("91%"),
minWidth: wp("91%"),
height: hp("8%"),
minHeight: hp("8%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("5%"),
top: hp("88%"),
backgroundColor: "rgba(127, 61, 255, 1)"
},
View_I816_214_568_4137: {
flexGrow: 1,
width: wp("18%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("37%"),
top: hp("2%"),
justifyContent: "center"
},
Text_I816_214_568_4137: {
color: "rgba(252, 252, 252, 1)",
fontSize: 14,
fontWeight: "400",
textAlign: "center",
fontStyle: "normal",
letterSpacing: 0,
textTransform: "none"
},
View_816_215: {
width: wp("91%"),
minWidth: wp("91%"),
height: hp("8%"),
minHeight: hp("8%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("5%"),
top: hp("98%"),
backgroundColor: "rgba(238, 229, 255, 1)"
},
View_I816_215_568_4847: {
flexGrow: 1,
width: wp("13%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("39%"),
top: hp("2%"),
justifyContent: "center"
},
Text_I816_215_568_4847: {
color: "rgba(127, 61, 255, 1)",
fontSize: 14,
fontWeight: "400",
textAlign: "left",
fontStyle: "normal",
letterSpacing: 0,
textTransform: "none"
},
View_816_818: {
width: wp("100%"),
minWidth: wp("100%"),
height: hp("6%"),
minHeight: hp("6%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
top: hp("0%"),
backgroundColor: "rgba(255, 255, 255, 1)"
},
View_I816_818_816_137: {
flexGrow: 1,
width: wp("14%"),
height: hp("2%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("5%"),
top: hp("2%")
},
View_I816_818_816_138: {
width: wp("14%"),
minWidth: wp("14%"),
minHeight: hp("2%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
top: hp("0%"),
justifyContent: "flex-start"
},
Text_I816_818_816_138: {
color: "rgba(22, 23, 25, 1)",
fontSize: 12,
fontWeight: "400",
textAlign: "center",
fontStyle: "normal",
letterSpacing: -0.16500000655651093,
textTransform: "none"
},
View_I816_818_816_139: {
flexGrow: 1,
width: wp("18%"),
height: hp("2%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("78%"),
top: hp("2%")
},
View_I816_818_816_140: {
width: wp("7%"),
minWidth: wp("7%"),
height: hp("2%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("11%"),
top: hp("0%")
},
View_I816_818_816_141: {
width: wp("7%"),
height: hp("2%"),
top: hp("0%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%")
},
ImageBackground_I816_818_816_142: {
width: wp("6%"),
minWidth: wp("6%"),
height: hp("2%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
top: hp("0%")
},
ImageBackground_I816_818_816_145: {
width: wp("0%"),
minWidth: wp("0%"),
height: hp("1%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("6%"),
top: hp("1%")
},
View_I816_818_816_146: {
width: wp("5%"),
minWidth: wp("5%"),
height: hp("1%"),
minHeight: hp("1%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("1%"),
top: hp("0%"),
backgroundColor: "rgba(22, 23, 25, 1)",
borderColor: "rgba(76, 217, 100, 1)",
borderWidth: 1
},
View_I816_818_816_147: {
width: wp("5%"),
height: hp("1%"),
top: hp("0%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%")
},
View_I816_818_816_148: {
width: wp("1%"),
minWidth: wp("1%"),
height: hp("1%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
top: hp("1%"),
backgroundColor: "rgba(255, 255, 255, 1)"
},
View_I816_818_816_149: {
width: wp("1%"),
minWidth: wp("1%"),
height: hp("1%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("1%"),
top: hp("1%"),
backgroundColor: "rgba(255, 255, 255, 1)"
},
View_I816_818_816_150: {
width: wp("1%"),
minWidth: wp("1%"),
height: hp("1%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("3%"),
top: hp("0%"),
backgroundColor: "rgba(255, 255, 255, 1)"
},
View_I816_818_816_151: {
width: wp("1%"),
minWidth: wp("1%"),
height: hp("1%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("4%"),
top: hp("0%"),
backgroundColor: "rgba(255, 255, 255, 1)"
},
ImageBackground_I816_818_816_152: {
width: wp("4%"),
minWidth: wp("4%"),
height: hp("2%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("6%"),
top: hp("0%")
},
View_1271_5695: {
width: wp("83%"),
minWidth: wp("83%"),
height: hp("43%"),
minHeight: hp("43%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("8%"),
top: hp("10%"),
backgroundColor: "rgba(0, 0, 0, 0)"
},
View_I1271_5695_1271_5631: {
flexGrow: 1,
width: wp("83%"),
height: hp("43%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
top: hp("0%"),
backgroundColor: "rgba(196, 196, 196, 1)"
},
View_I1271_5695_1271_5592: {
flexGrow: 1,
width: wp("83%"),
height: hp("43%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
top: hp("0%")
},
ImageBackground_I1271_5695_1271_5593: {
width: wp("98%"),
height: hp("31%"),
top: hp("5%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("6%")
},
View_I1271_5695_1271_5594: {
width: wp("96%"),
height: hp("35%"),
top: hp("2%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("7%")
},
ImageBackground_I1271_5695_1271_5595: {
width: wp("87%"),
height: hp("27%"),
top: hp("4%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("5%")
},
View_I1271_5695_1271_5596: {
width: wp("64%"),
height: hp("24%"),
top: hp("5%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("17%")
},
View_I1271_5695_1271_5597: {
width: wp("59%"),
height: hp("19%"),
top: hp("5%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("1%")
},
View_I1271_5695_1271_5598: {
width: wp("42%"),
height: hp("10%"),
top: hp("0%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("6%")
},
ImageBackground_I1271_5695_1271_5599: {
width: wp("23%"),
height: hp("6%"),
top: hp("2%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("19%")
},
View_I1271_5695_1271_5600: {
width: wp("14%"),
height: hp("6%"),
top: hp("1%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("4%")
},
View_I1271_5695_1271_5601: {
width: wp("9%"),
height: hp("4%"),
top: hp("2%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("1%"),
borderColor: "rgba(145, 145, 159, 1)",
borderWidth: 3
},
ImageBackground_I1271_5695_1271_5602: {
width: wp("10%"),
height: hp("5%"),
top: hp("0%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("2%")
},
View_I1271_5695_1271_5603: {
width: wp("39%"),
height: hp("10%"),
top: hp("4%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("11%")
},
ImageBackground_I1271_5695_1271_5604: {
width: wp("23%"),
height: hp("6%"),
top: hp("2%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("16%")
},
View_I1271_5695_1271_5605: {
width: wp("9%"),
height: hp("3%"),
top: hp("3%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("2%")
},
View_I1271_5695_1271_5606: {
width: wp("9%"),
height: hp("3%"),
top: hp("0%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
borderColor: "rgba(145, 145, 159, 1)",
borderWidth: 3
},
View_I1271_5695_1271_5607: {
width: wp("40%"),
height: hp("10%"),
top: hp("9%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("13%")
},
ImageBackground_I1271_5695_1271_5608: {
width: wp("23%"),
height: hp("7%"),
top: hp("2%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("16%")
},
View_I1271_5695_1271_5609: {
width: wp("9%"),
height: hp("3%"),
top: hp("3%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("2%")
},
View_I1271_5695_1271_5610: {
width: wp("9%"),
height: hp("3%"),
top: hp("0%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
borderColor: "rgba(145, 145, 159, 1)",
borderWidth: 3
},
ImageBackground_I1271_5695_1271_5611: {
width: wp("29%"),
height: hp("4%"),
top: hp("2%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("13%")
},
ImageBackground_I1271_5695_1271_5612: {
width: wp("34%"),
height: hp("6%"),
top: hp("3%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("32%")
},
View_816_224: {
width: wp("100%"),
minWidth: wp("100%"),
height: hp("5%"),
minHeight: hp("5%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
top: hp("106%"),
backgroundColor: "rgba(0, 0, 0, 0)"
},
View_I816_224_217_6977: {
flexGrow: 1,
width: wp("36%"),
height: hp("1%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("32%"),
top: hp("3%"),
backgroundColor: "rgba(0, 0, 0, 1)"
}
})
const mapStateToProps = state => {
return {}
}
const mapDispatchToProps = () => {
return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(Blank)
|
module.exports = {
"authorName": "Denise",
"authorLastName": "Ceriotti"
}
|
var $=require('jquery');
import RevealOnScroll from './modules/RevealOnScroll';
import StickyHeader from './modules/StickyHeaher';
new RevealOnScroll($(".feature-item"),"85%");
new RevealOnScroll($(".testimonial"),"60%");
stickyHeader=new StickyHeader();
|
// Дополни метод updatePotionName(oldName, newName) так, чтобы он обновлял название
// зелья с oldName на newName, в массиве зелий в свойстве potions.
const atTheOldToad = {
potions: ['Зелье скорости', 'Дыхание дракона', 'Каменная кожа'],
updatePotionName(oldName, newName) {
// Пиши код ниже этой строки
const toadIndex = this.potions.indexOf(oldName);
this.potions.splice(toadIndex, 1, newName);
// Пиши код выше этой строки
},
};
|
document.addEventListener('DOMContentLoaded', function() {
var map = L.map('map').setView([43.8041,-120.5542], 8);
L.esri.basemapLayer("Topographic").addTo(map);
L.esri.dynamicMapLayer({
url: "https://mapservices.nps.gov/arcgis/rest/services/LandResourcesDivisionTractAndBoundaryService/MapServer",
opacity: 1
}).addTo(map);
L.esri.featureLayer({
url: "https://gis.blm.gov/orarcgis/rest/services/Facility/BLM_OR_Recreation_Site/MapServer/0",
pointToLayer: function (geojson, latlng) {
return L.circleMarker(latlng, {
color: 'white',
weight: 2,
fillColor: 'darkorange',
fillOpacity: 0.6
});
}
}).addTo(map);
L.esri.featureLayer({
url: "https://gis.blm.gov/orarcgis/rest/services/Facility/BLM_OR_Recreation_Site/MapServer/1",
pointToLayer: function (geojson, latlng) {
return L.circleMarker(latlng, {
color: 'white',
weight: 2,
fillColor: 'red',
fillOpacity: 0.6
});
}
}).addTo(map);
L.esri.featureLayer({
url: "https://gis.blm.gov/orarcgis/rest/services/Facility/BLM_OR_Recreation_Site/MapServer/2",
pointToLayer: function (geojson, latlng) {
return L.circleMarker(latlng, {
color: 'white',
weight: 2,
fillColor: 'yellow',
fillOpacity: 0.6
});
}
}).addTo(map);
L.esri.featureLayer({
url: "https://gis.blm.gov/orarcgis/rest/services/Facility/BLM_OR_Recreation_Site/MapServer/3",
pointToLayer: function (geojson, latlng) {
return L.circleMarker(latlng, {
color: 'white',
weight: 2,
fillColor: 'brown',
fillOpacity: 0.6
});
}
}).addTo(map);
L.esri.featureLayer({
url: "https://gis.blm.gov/orarcgis/rest/services/Facility/BLM_OR_Recreation_Site/MapServer/4",
pointToLayer: function (geojson, latlng) {
return L.circleMarker(latlng, {
color: 'white',
weight: 2,
fillColor: 'green',
fillOpacity: 0.6
});
}
}).addTo(map);
map.on('mousemove', showLatLng);
function showLatLng(e) {
document.getElementById("latandlong").innerText = (e.latlng.lat).toFixed(5) + " | " + (e.latlng.lng).toFixed(5);
}
function setMapView(zoomLevel, latitude, longitude) {
map.setView([latitude, longitude], zoomLevel);
}
function setMapView(zoomLevel, latitude, longitude) {
map.setView([43.8041,-120.5542], 8);
}
document.getElementById("goTo").onclick=setMapView;
{
;
};
function ReplacingImage() {
document.getElementById("Oregon State Park Img").src="OSimage.jpg";
}
var searchControl = L.esri.Geocoding.geosearch().addTo(map);
var results = L.layerGroup().addTo(map);
searchControl.on('results', function(data){
results.clearLayers();
for (var i = data.results.length - 1; i >= 0; i--) {
results.addLayer(L.marker(data.results[i].latlng));
}
});
/*
map.setView([43.8041,-123.5542], 16)
*/
});
|
export const host = process.env.REACT_APP_HOST || "https://digitalscratchboard.herokuapp.com"
|
const path = require('path');
const webpack = require('webpack');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const HtmlWebPackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
entry: {
feed : "./src/feed/index.js",
pm : "./src/pm/index.js"
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "[hash:8].js"
},
resolve : {
alias : {
'@material-ui/core' : '@material-ui/core/es'
}
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test : /\.css$/,
use : [
{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: (resourcePath, context) => {
return path.relative(path.dirname(resourcePath), context) + '/';
},
hmr: process.env.NODE_ENV === 'development',
},
},
'css-loader',
]
},
{
test: /\.(less)$/,
use : [
MiniCssExtractPlugin.loader,
"css-loader",
"less-loader"
]
},
]
},
optimization : {
minimizer: [
new TerserPlugin({
test: /\.js(\?.*)?$/i,
parallel: true,
extractComments: true,
}),
],
runtimeChunk: {
name: entrypoint => `runtime~${entrypoint.name}`
},
namedModules: true,
splitChunks : {
chunks: 'async',
minChunks: 2,
minSize: 0,
maxAsyncRequests: 5,
maxInitialRequests: 3,
automaticNameDelimiter: '~',
automaticNameMaxLength: 30,
name: true,
cacheGroups: {
vendors : {
test : /[\\/]node_modules[\\/]/,
priority : -10,
name : module => {
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
return `vendor.${packageName.replace('@', '')}`;
},
chunks : 'all'
},
styles: {
name: 'styles',
test: /\.css$/,
chunks: 'all',
enforce: true,
},
default : {
minChunks: 2,
priority: -20,
reuseExistingChunk: true
}
}
}
},
plugins: [
new webpack.HashedModuleIdsPlugin(),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.ProvidePlugin({
"React": "react",
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV' : JSON.stringify('production')
}),
new MiniCssExtractPlugin({ filename: "[hash:8].[contentHash].css" }),
new CleanWebpackPlugin(),
new HtmlWebPackPlugin({
template: "../views/index.html",
filename: "../../feed/index.html",
chunks: ['feed']
}),
new HtmlWebPackPlugin({
template: "../views/pm/index.html",
filename: "../../pm/index.html",
chunks: ['pm']
})
]
};
|
// given a youtube video ID
// downloads video from youtube
// converts to mp3 file
// splits mp3 into multiple hour long chunks
// uploads to s3
// create and upload a podcast XML file
var path = require('path');
var getNextPlaylistVideo = require('./youtube-playlist');
var saveVideoToMP3 = require('./youtube-audio-stream');
var chunkify = require('./chunkify');
var generateRSS = require('./generate-rss');
var generateHTML = require('./generate-html');
// var generateAudioHTML = require('./generate-audio-html');
var S3 = require('./s3');
var fs = require('fs');
var moment = require('moment');
var combinePodcasts = require('./combine-podcasts');
var Constants = require('./constants');
var publishedPodcasts = null;
var newPodcast = {};
var slugToFetch = process.argv[2];
getNextPlaylistVideo()
.then((data) => {
publishedPodcasts = data.publishedPodcasts;
if (slugToFetch) {
var filePath = `downloads/${slugToFetch}.mp3`;
console.log('Processing file', filePath);
newPodcast.slug = slugToFetch;
newPodcast.videoId = publishedPodcasts[slugToFetch] && publishedPodcasts[slugToFetch].videoId;
if (fs.existsSync(filePath)) {
return filePath;
}
}
else {
newPodcast.slug = data.nextUnpublishedVideoSlug;
newPodcast.videoId = data.nextUnpublishedVideoId;
}
if (!newPodcast.slug) {
throw new Error('Nothing to do.');
}
console.log('New podcast:', newPodcast)
return saveVideoToMP3(newPodcast.videoId);
})
.then(chunkify)
.then((newPodcastSize) => {
console.log('newPodcastSize:', newPodcastSize);
newPodcast.size = newPodcastSize;
newPodcast.pubDate = nextPubDate();
return newPodcast;
})
.then(generateRSS)
.then(S3.uploadDir)
.then(() => {
// update index.json
console.log('Updating index.json');
publishedPodcasts[newPodcast.slug] = {
hours: newPodcast.size,
pubDate: newPodcast.pubDate,
};
fs.writeFileSync('./index.json', JSON.stringify(publishedPodcasts));
return S3.uploadFile('./index.json', Constants.PODCASTS_JSON_PATH);
})
.then(() => {
// update index.html
console.log('Updating index.html');
generateHTML(publishedPodcasts);
})
.then(() => {
return S3.uploadFile('./index.html', Constants.PODCASTS_HTML_PATH);
})
.then(() => {
// update index.xml
console.log('Updating index.xml');
return combinePodcasts(publishedPodcasts);
})
.then(() => {
return S3.uploadFile('./index.xml', Constants.PODCASTS_XML_PATH);
})
/*
.then(() => {
// update slug/audio.html
console.log('Updating audio.html for', slug);
return updateAudioIndexes(publishedPodcasts);
})
.then(() => {
return S3.uploadFile('./index.xml', Constants.PODCASTS_XML_PATH);
})
*/
.catch(function(err) {
console.log('Error:', err);
return 1;
});
function nextPubDate() {
var keys = null;
if (!publishedPodcasts || (keys=Object.keys(publishedPodcasts)).length === 0) {
return moment('2016-02-01T00:00:00-08:00').format();
}
var now = moment();
var minMinutes = Infinity;
var minKey = null;
keys.forEach((key) => {
var item = publishedPodcasts[key];
var pubDate = moment(item.pubDate);
var minutesSincePubDate = (now.diff(pubDate) / 1000) / 60;
if (minutesSincePubDate < minMinutes) {
minMinutes = minutesSincePubDate;
minKey = key;
}
});
var item = publishedPodcasts[minKey];
console.log('key:', minKey, publishedPodcasts);
var pubDate = moment(item.pubDate);
pubDate.add(item.hours, 'minutes');
return pubDate.format();
}
function updateAudioIndexes(podcasts) {
Object.keys(podcasts).forEach(function(slug) {
var onePodcast = podcasts[slug];
var outputDir = slug;
for (var chunkNum=0; chunkNum < onePodcast.hours; chunkNum++) {
var chunkName = (path.join(outputDir, 'hour' +
(chunkNum < 9 ? '0' : '') +
(chunkNum+1) + '.mp3'));
return new Promise(function(resolve, reject) {
if (fs.existsSync(chunkName)) {
// console.log('Chunk exists:', chunkName);
resolve();
return;
}
else {
fs.writeFileSync(`./${slug}/index.json`, JSON.stringify(publishedPodcasts));
}
});
}
// generateAudioHTML(slug, )
});
}
|
const { userMutations } = require('./userMutations');
exports.allUserMutations = `
${ userMutations }
`;
|
// @flow
import { BookingPaymentScreen } from '../BookingPaymentScreen';
const ONE_DAY = 8.64e7; // ms
it('creates correct URL', () => {
expect(
new BookingPaymentScreen({
hotelId: '1',
checkin: new Date(ONE_DAY),
checkout: new Date(3 * ONE_DAY), // 2 days later
roomConfig: [
{
roomId: '7709411_91461863_1_1_0',
count: 1,
},
{
roomId: '7709404_91461863_0_1_0',
count: 2,
},
],
currency: 'EUR',
version: 'rn-test',
}).createURI('http://test.url.lol'),
).toMatchSnapshot();
expect(
new BookingPaymentScreen({
hotelId: '2',
checkin: new Date(2 * ONE_DAY),
checkout: new Date(16 * ONE_DAY), // 14 days later
roomConfig: [
{
roomId: '7709411_91461863_1_1_0',
count: 5,
},
],
currency: 'JPY',
version: 'rn-test',
}).createURI('http://test.url.lol'),
).toMatchSnapshot();
});
|
yellow_2_interval_name = ["新營","人和里","柳營","龜子港","林鳳營","中社","六甲","六甲<br />營房","南元<br />農場","冷水寮","尖山路","土地崎","王爺宮","西港湖","北勢<br />坑口","大丘","西口<br />小瑞士"];
yellow_2_interval_stop = [ // 2018.01.31 checked
["新營站","第三市場","新營國小","圓環(第一銀行)","新進路口","真武殿","南光中學"], // 新營
["人和里"], // 人和里
["士林里","柳營","新榮中學","南士林"], // 柳營
["嘉南駕訓班","龜子港(省道)","社區"], // 龜子港
["林鳳營火車站","林鳳營"], // 林鳳營
["中社","東中社"], // 中社
["中山路社區","水林","六甲區公所","冰廠","六甲市場","六甲國中","六甲衛生所","六甲","六甲廟後"], // 六甲
["六甲營房","工研院南分院"], // 六甲營房
["曾文街","南元農場"], // 南元農場
["冷水寮"], // 冷水寮
["尖山路"], // 尖山路
["土地崎"], // 土地崎
["番仔坑","王爺宮"], // 王爺宮
["西港湖","桶頭腳"], // 西港湖
["北勢坑口"], // 北勢坑口
["嶺頂","大丘派出所","匏仔寮"], // 大丘
["西口小瑞士"] // 西口小瑞士
];
yellow_2_fare = [
[26],
[26,26],
[26,26,26],
[26,26,26,26],
[30,26,26,26,26],
[35,26,26,26,26,26],
[50,41,35,26,26,26,26],
[57,49,43,34,27,26,26,26],
[62,53,48,38,32,27,26,26,26],
[66,57,52,42,36,31,26,26,26,26],
[71,62,56,47,40,35,26,26,26,26,26],
[73,65,59,50,43,38,26,26,26,26,26,26],
[78,69,64,54,48,43,28,26,26,26,26,26,26],
[87,78,73,63,57,52,37,30,26,26,26,26,26,26],
[96,87,82,72,65,61,46,38,34,30,26,26,26,26,26],
[108,99,93,84,77,72,58,50,45,42,37,34,30,26,26,26],
[120,111,106,96,90,85,70,62,58,54,49,46,42,33,26,26,26]
];
// format = [time at the start stop] or
// [time, other] or
// [time, start_stop, end_stop, other]
yellow_2_main_stop_name = ["新營站","柳營","龜子港<br />(省道)","林鳳營","六甲","工研院<br />南分院","王爺宮","西港湖","北勢<br />坑口","匏仔寮","西口<br />小瑞士"];
yellow_2_main_stop_time_consume = [0, 9, 15, 18, 30, 37, 50, 55, 59, 66, 72];
yellow_2_important_stop = [0, 3, 4, 6, 10]; // 新營站, 林鳳營, 六甲, 王爺宮, 西口小瑞士
var Sinying = 0; // 新營站
var Liouying = 1; // 柳營
var Gueizihgang = 2; // 龜子港(省道)
var Linfongying = 3; // 林鳳營
var Lioujia = 4; // 六甲
var ITRI = 5; // 工研院南分院
var Wangye_Temple = 6; // 王爺宮
var Sigang_Lake = 7; // 西港湖
var Beishihkengkou = 8; // 北勢坑口
var Paozihlaio = 9; // 匏仔寮
var Sikou_Little_Swiss = 10; // 西口小瑞士
yellow_2_time_go = [["05:40",[[Liouying,-3,Gueizihgang,-3,Lioujia,-4,Wangye_Temple,-4,Sigang_Lake,-1,Beishihkengkou,-1,]]],
["07:30",Sinying,Wangye_Temple,[[Liouying,1,Gueizihgang,-1]]],
["11:00",[[Gueizihgang,-1,Lioujia,1]]],
["14:20",Sinying,Wangye_Temple,[[Gueizihgang,-2,Lioujia,2]]],
["16:40",[[Liouying,1,Gueizihgang,-1,Linfongying,1,Lioujia,1,ITRI,1,Wangye_Temple,-3,Beishihkengkou,1,Paozihlaio,4,Sikou_Little_Swiss,-1]]],
["17:45",Sinying,Wangye_Temple,[[Liouying,5,Linfongying,3,Lioujia,4,ITRI,2,Wangye_Temple,1]]]];
yellow_2_time_return = [["06:00",Wangye_Temple,Sinying,[ITRI,[ITRI,-5]]],
["06:40",[[Beishihkengkou,-2,ITRI,-4,Liouying,-1,Sinying,6]]],
["08:25",Wangye_Temple,Sinying,[[ITRI,-3,Lioujia,1,Linfongying,1,Gueizihgang,1]]],
["12:20",[[Beishihkengkou,-1,Wangye_Temple,-1,ITRI,-3,Lioujia,1,Linfongying,1,Gueizihgang,1,Liouying,-1,Sinying,1]]],
["15:15",Wangye_Temple,Sinying,[[ITRI,-3,Lioujia,1,Gueizihgang,1,Liouying,-1,Sinying,2]]],
["18:10",[[Beishihkengkou,-1,Wangye_Temple,-1,ITRI,-3,Lioujia,1,Gueizihgang,1,Liouying,-1,Sinying,1]]]];
|
$(document).ready(function () {
var sum = 0.0;
$(".dugme").click(function () {
$("#pitanja").submit(function(e) {
e.preventDefault();
});
if ($("[name = radio1]").is(':checked')) {
var check_value = $('.prviRadio:checked').val();
sum = sum + parseFloat(check_value);
}
else{
sum = sum + 0;
}
if ($("[name = radio2]").is(':checked')) {
var check_value = $('.drugiRadio:checked').val();
sum = sum + parseFloat(check_value);
}
else{
sum = sum + 0;
}
if ($("[name = radio3]").is(':checked')) {
var check_value = $('.treciRadio:checked').val();
sum = sum + parseFloat(check_value);
}
else{
sum = sum + 0;
}
if ($("[name = check11]").is(':checked') && $("[name = check13]").is(':checked')) {
sum = sum + 1;
} else {
sum = sum + 0;
}
if ($("[name = check21]").is(':checked') && $("[name = check22]").is(':checked')) {
sum = sum + 1;
} else {
sum = sum + 0;
}
alert("Uspešno ste uradili zadatak, vaš broj bodova je: " + sum + "/5");
});
$(".dugme2").click(function () {
$("#pitanja").submit(function(e) {
e.preventDefault();
});
$('input[type=checkbox]').each(function () {
this.checked = false;
});
$('input[type=radio]').each(function () {
this.checked = false;
});
});
$(".dugme3").click(function(){
$("#pitanja").submit(function(e) {
e.preventDefault();
});
$(".N1").css("background-color","red");
$(".T1").css("background-color","green");
});
});
|
console.time('data creation time');
const fs = require('fs');
const faker = require('faker');
//fake data file location:
//C:\Users\Mark\Documents\GitHub\nate-fec\dbms_server\tmp\fakeReviews\fakeReviews*.csv
//C:\Users\Mark\Documents\GitHub\nate-fec\dbms_server\tmp\fakeReviewsPhotos\fakeReviews*.csv
let writeBlock = 0;
let numOfReviews = 1000000;
let maxReviewPhotosPerReview = 5;
let numOfProducts = 100000;
while (writeBlock <= 9) {
writeBlock++;
let totalFakeReviewsString = 'product,rating,summary,recommend,response,body,date,reviewer_name,helpfulness,photos\n';
let totalFakeReviewsPhotosString = 'id,url,review_id\n';
for (let i = (1 + (writeBlock - 1) * numOfReviews); i <= (writeBlock * numOfReviews); i++) {
let review_id = i;
let product = Math.ceil(Math.random() * numOfProducts);
let rating = Math.floor(Math.random() * 6);
let summary = faker.lorem.paragraph();
let recommend = Math.floor(Math.random() * 2);
let response = '';
let body = faker.lorem.sentence();
let randMonth = JSON.stringify(Math.floor(Math.random() * 13));
if (randMonth.length === 1) {
randMonth = '0' + randMonth;
}
let randDay = JSON.stringify(Math.floor(Math.random() * 29));
if (randDay.length === 1) {
randDay = '0' + randDay;
}
let date = '2019-' + randMonth + '-' + randDay + 'T00:00:00.000Z';
let reviewer_name = faker.name.findName();
let helpfulness = Math.floor(Math.random() * 101);
let photos = [];
for (let j = 0; j < Math.floor(Math.random() * (maxReviewPhotosPerReview + 1)); j++) {
let pic = {'id': j, 'url': faker.image.fashion()};
photos.push(pic);
// let id = j;
// let url = faker.image.fashion();
// let eachFakeReviewsPhotosString = id + ',' + url + ',' + review_id + '\n';
// totalFakeReviewsPhotosString += eachFakeReviewsPhotosString;
}
if (photos !== []) {
photos = JSON.stringify(photos);
photos = photos.split(',');
photos = photos.join('-');
} else {
photos = JSON.stringify(photos);
}
//creates review string
let eachFakeReviewsString = product + ',' + rating + ',' + summary + ',' + recommend + ',' + response + ',' + body + ',' + date + ',' + reviewer_name + ',' + helpfulness + ',' + photos + '\n';
totalFakeReviewsString += eachFakeReviewsString;
}
// writeToFile(totalFakeReviewsString, totalFakeReviewsPhotosString, writeBlock);
fs.writeFileSync(`./tmp/fakeReviews/fakeReviews${writeBlock}.csv`, totalFakeReviewsString, (err) => {
if (err) {
console.log(err);
} else {
console.log(`write reviews file ${writeBlock} success!`);
if (block === 9) {
console.timeEnd('data creation time');
}
}
});
}
// fs.writeFileSync(`./tmp/fakeReviewsPhotos/fakeReviewsPhotos${writeBlock}.csv`, totalFakeReviewsPhotosString, (err) => {
// if (err) {
// console.log(err);
// } else {
// console.log(`write reviews photos file ${writeBlock} success!`);
// }
// });
// };
console.timeEnd('data creation time');
|
/**
* Find the size of the entire legend box
* @param {[String]} plotName [Naming convention for class]
* @param {[Function]} color [Color function]
* @param {[String]} legendTitle [Title of the legend]
* @return {[Object]} obj [Object containing the height and width of the legend]
*/
function getLegendSize(plotName, color, legendTitle) {
createLegend(plotName, color, legendTitle);
var obj = {
height: chart.objs.legend.node().getBBox().height,
width: chart.objs.legend.node().getBBox().width
}
if(chart.objs.legend) {
chart.objs.legend.selectAll('g').remove();
chart.objs.legend.selectAll('text').remove();
}
chart.objs.legend.remove();
return obj;
}
/**
* Adjust the chart size and regenerate the legend
* @param {[String]} plotName [Naming convention for class]
* @param {[Object]} legendSize [Object containing the height and width of the legend]
* @param {[Function]} color [Color function]
* @param {[String]} legendTitle [Title of the legend]
* @return
*/
function generateLegend(plotName, legendSize, color, legendTitle) {
// Constant number 22 to overrides the miss offset given by getBBox() function
chart.width -= (legendSize.width + 22);
chart.xScale.range([0, chart.width]);
chart.objs.xAxis.scale(chart.xScale);
chart.objs.axes.xAxis.call(chart.objs.xAxis);
chart.objs.g.select('.x.axis .label')
.attr('x', chart.width / 2);
chart.objs.g.select('.x.axis .caption')
.attr('x', chart.width / 2);
chart.objs.yAxis.tickSizeInner(-chart.width);
chart.objs.axes.yAxis.call(chart.objs.yAxis);
createLegend(plotName, color, legendTitle);
}
/**
* Create the legend
* @param {[String]} plotName [Naming convention for class]
* @param {[Function]} color [Color function]
* @param {[String]} legendTitle [Title of the legend]
* @return
*/
function createLegend(plotName, color, legendTitle) {
var legendRectSize = 18;
var legendSpacing = 4;
chart.objs.legend = chart.objs.g.append('g')
.attr('class', 'legend-wrapper');
chart.objs.legend.append('text')
.attr('class', 'legend-title')
.attr('x', chart.width + legendSpacing)
.attr('y', 0)
.text(legendTitle.toUpperCase());
var lgd = chart.objs.legend.selectAll('.legend')
.data(padDataAndSort(color.domain()))
.enter()
.append('g')
.attr('class', 'legend-point')
.attr('transform', function(d, i){
var height = legendRectSize + legendSpacing;
var horz = chart.width + legendSpacing;
var vert = i * height + 5;
return 'translate(' + horz + ',' + vert + ')';
});
lgd.append('rect')
.attr('class', plotName + '-legend')
.attr('width', legendRectSize)
.attr('height', legendRectSize)
.style('fill', color)
.style('stroke', color);
lgd.append('text')
.attr('x', legendRectSize + legendSpacing)
.attr('y', legendRectSize - legendSpacing)
.style('fill', 'black')
.text(function(d) { return d; });
}
|
const { history, location } = window
const paths = location.pathname.split('/')
export const go = (username, state = false) => {
if (state === false) {
history.replaceState({}, '', '/' + username)
} else {
const { category, articleId } = state
history.replaceState(state, '', '/' + username + '/' + category + '/' + articleId)
}
location.reload()
}
export const push = (articleId, category, username) => {
history.pushState({ articleId, category }, '', '/' + username + '/' + category + '/' + articleId)
}
export const replace = (articleId, category, username) => {
history.replaceState({ articleId, category }, '', '/' + username + '/' + category + '/' + articleId)
}
export const params = key => {
switch (key) {
case 'username':
return paths[1]
case 'category':
return paths[2]
case 'articleId':
return paths[3]
default:
return undefined
}
}
export const addListener = callback => {
window.addEventListener('popstate', callback, false)
}
|
// tailwind.config.js
const defaultTheme = require('tailwindcss/defaultTheme');
module.exports = {
future: {},
purge: [],
theme: {
extend: {
fontFamily: {
sans: ['Nunito', ...defaultTheme.fontFamily.sans],
Tajawal: 'sans-serif',
},
animation: {
bounce: 'bounce 1s finite',
},
width: {
70: '20rem',
},
colors: {
background: {
primary: 'var(--bg-background-primary)',
secondary: 'var(--bg-background-secondary)',
tertiary: 'var(--bg-background-tertiary)',
pinck: 'var(--bg-background-pinck)',
},
textColor: {
primary: 'var(--text-textColor-primary)',
secondary: 'var(--text-textColor-secondary)',
},
'border-color': {
primary: 'var(--border-border-color-primary)',
},
},
},
},
variants: {},
plugins: [],
};
|
function logIn() {
var form = $("#login-form");
var login = form.find('input[name="login"]').val();
var password = form.find('input[name="password"]').val();
$.ajax({
type: 'POST',
url: '/login',
headers: {
'X-CSRF-TOKEN': $('meta[name=_csrf]').attr("content")
},
data: {
login: login,
password: password
},
success: function (data) {
console.log("Login success! " + JSON.stringify(data));
if (data.status == "success") {
location = "/";
} else {
var alert = $('<div id="login-header-alert" class="alert alert-danger" role="alert">' +
"Login failed</div>");
$("#login-header-alert").replaceWith(alert);
}
},
error: function (data) {
console.error("Login failure! " + JSON.stringify(data));
}
});
}
function register() {
var form = $("#registration-form");
var lastName = form.find('input[name="lastName"]').val();
var firstName = form.find('input[name="firstName"]').val();
var patronymicName = form.find('input[name="patronymicName"]').val();
var login = form.find('input[name="login"]').val();
var password = form.find('input[name="password"]').val();
$.ajax({
type: 'POST',
url: '/register',
headers: {
'X-CSRF-TOKEN': $('meta[name=_csrf]').attr("content")
},
processData: false,
contentType: 'application/json',
data: JSON.stringify({
lastName: lastName,
firstName: firstName,
patronymicName: patronymicName,
login: login,
password: password
}),
success: function (data) {
var alert;
if (data.status == 'success') {
console.log("Registration success! " + JSON.stringify(data));
location = "/";
} else {
console.log("Registration error! " + JSON.stringify(data));
alert = $('<div id="registration-header-alert" class="alert alert-danger" role="alert">' +
data.message + '</div>');
$("#registration-header-alert").replaceWith(alert);
}
},
error: function (data) {
console.error("Registration error! " + JSON.stringify(data));
var alert = $('<div id="registration-header-alert" class="alert alert-danger" role="alert">' +
"Registration failed</div>");
$("#registration-header-alert").replaceWith(alert);
}
});
}
|
/*
David Jensen
SDI Section #3
Go To Training Day #2
2015/01/16
*/
// alert("Testing to see if the JS file is attached to the HTML.");
// Create an age calculator
// Ask the user their name
var name = prompt("Please type in your name:");
// console.log out the name
console.log(name);
// Welcome the user with an alert
alert("Welcom "+name+"! Let's figure out how old you are.");
//Ask the user what year they are born
//age = current year subtract the year they were born
//Create a variable to catch the promted answer
var yearBorn=prompt("What year were you born");
console.log(yearBorn);
//What is the current Year?
var currentYear=2015;
//Calculate the age - create a variable for results
//2015 - "1975" - 1 = 36
var age=currentYear-yearBorn-1;
console.log(name+" you are "+age+" years old.");
alert(name+" you are "+age+" years old.");
//Make it MORE complex
//Ask user how many years in the future they would like to know their age.
var yearsMore = prompt("How many years in the future would you like to know your age?");
console.log(yearsMore);
//Calculate future age
// + plus sign does double duty - ADDition and Concatenation
//prompts ONLY return text strings!
// 10 - returns "10"
//"3910" not equal #3910
//Casting or Parsing an integer
//Casting - Number() is when we treat one variable type as another temporarily
//parseInt() looks for a leading number in a text string
var futureAge = Number(age)+parseInt(yearsMore);
console.log(futureAge);
//Create a final out text string variable
var finalOutput = "You will be "+futureAge+" in "+yearsMore+" years.";
console.log(finalOutput);
alert(finalOutput);
/*
var a = Number("40 years old");
console.log(a);
var b = Number("40");
console.log(b);
//Returns NaN - Not a Number
var c = parseInt("40");
console.log(c);
var d = parseInt("40 years old");
console.log(d);
var f = parseInt("I am 40 years old");
console.log(f);
*/
|
/**
* Copyright 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
goog.provide('audioCat.ui.toolbar.RenderToolbar');
goog.require('audioCat.ui.toolbar.Toolbar');
goog.require('audioCat.ui.toolbar.item.DownloadMp3Item');
goog.require('audioCat.ui.toolbar.item.DownloadWavItem');
goog.require('audioCat.ui.toolbar.item.RenderToTrackItem');
/**
* A toolbar with items for rendering and downloading audio.
* @param {!audioCat.action.ActionManager} actionManager Manages actions.
* @param {!audioCat.audio.render.ExportManager} exportManager Manages exporting
* of audio.
* @param {!audioCat.audio.render.AudioRenderer} audioRenderer Renders audio.
* @param {!audioCat.utility.IdGenerator} idGenerator Generates IDs unique
* throughout this single-threaded application.
* @param {!audioCat.state.command.CommandManager} commandManager Manages the
* history of commands.
* @param {!audioCat.state.prefs.PrefManager} prefManager Manages user
* preferences.
* @param {!audioCat.utility.DomHelper} domHelper Facilitates interactions with
* the DOM.
* @param {!audioCat.state.editMode.EditModeManager} editModeManager Manages the
* current edit mode.
* @param {!audioCat.ui.tooltip.ToolTip} toolTip Displays tips sometimes after
* user hovers over something.
* @constructor
* @extends {audioCat.ui.toolbar.Toolbar}
*/
audioCat.ui.toolbar.RenderToolbar = function(
actionManager,
exportManager,
audioRenderer,
idGenerator,
commandManager,
prefManager,
domHelper,
editModeManager,
toolTip) {
goog.base(this, domHelper, editModeManager, [
new audioCat.ui.toolbar.item.DownloadWavItem(
domHelper,
editModeManager,
exportManager,
actionManager,
toolTip),
new audioCat.ui.toolbar.item.DownloadMp3Item(
domHelper,
editModeManager,
exportManager,
actionManager,
prefManager,
toolTip),
new audioCat.ui.toolbar.item.RenderToTrackItem(
domHelper,
editModeManager,
actionManager,
audioRenderer,
toolTip)
]);
};
goog.inherits(audioCat.ui.toolbar.RenderToolbar, audioCat.ui.toolbar.Toolbar);
|
const menuData = [{
name: '首页',
icon: 'home',
path: 'home/index'
},{
name: '商户管理',
icon: 'dashboard',
path: 'merchant',
children: [{
name: '商户开户申请',
path: 'merchantOpen',
}/*, {
name: '商户信息列表',
path: 'merchantInfo',
}, {
name: '待审核列表',
path: 'review',
}],
},{
name: '门店管理',
icon: 'dashboard',
path: 'store',
children: [{
name: '门店列表',
path: 'list',
}*/],
}/*,{
name: '收银管理',
icon: 'dashboard',
path: 'transition',
children: [{
name: '交易明细查询',
path: 'flow',
},{
name: '交易汇总查询',
path: 'summary',
},{
name: '手续费汇总查询',
path: 'poundage',
},{
name: '交易对账',
path: 'billCheck',
}],
},{
name: '终端管理',
icon: 'dashboard',
path: 'terminal',
children: [{
name: '终端列表',
path: 'list',
}],
},{
name: '系统管理',
icon: 'dashboard',
path: 'system',
children: [{
name: '机构管理',
path: 'carrier',
},{
name: '渠道商管理',
path: 'institution',
},{
name: '用户管理',
path: 'user',
},{
name: '商户鉴权查询',
path: 'authentication',
},{
name: '角色管理',
path: 'role',
},{
name: '菜单管理',
path: 'menutree',
},{
name: '字典管理',
path: 'dict',
},{
name: '支付通道管理',
path: 'paychannel',
}],
}*/];
function formatter(data, parentPath = '', parentAuthority) {
return data.map((item) => {
const result = {
...item,
path: `${parentPath}${item.path}`,
authority: item.authority || parentAuthority,
};
if (item.children) {
result.children = formatter(item.children, `${parentPath}${item.path}/`, item.authority);
}
return result;
});
}
export const getMenuData = () => formatter(menuData);
|
function playSound(drumButton) {
var drumImageURL = getComputedStyle(drumButton).getPropertyValue("background-image")
// Strip folderpath from URL
drumImageURL = drumImageURL.substring(drumImageURL.lastIndexOf("/")+1,drumImageURL.lastIndexOf("\""))
var drumName = drumImageURL.substring(0,drumImageURL.lastIndexOf(".png"))
switch (drumName) {
case "tom1":
case "tom2":
case "tom3":
case "tom4":
drumName=drumName.substring(0,drumName.length-1)+"-"+drumName.substring(drumName.length-1);
break;
case "kick":
drumName=drumName+"-bass"
break;
default:
drumName=drumName;
}
var drumSoundURL = "sounds/"+drumName+".mp3"
var drumSound = new Audio(drumSoundURL);
drumSound.play();
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function buttonAnimation (drumButton) {
drumButton.classList.add("pressed");
setTimeout(function(){ drumButton.classList.remove("pressed");; }, 50);
// drumButton.classList.remove("pressed");
}
var drumButtons = document.querySelectorAll(".drum")
var drumButtonLetters=[];
for (var drumOrd=0;drumOrd<drumButtons.length;drumOrd++) {
drumButtonLetters.push(drumButtons[drumOrd].innerHTML);
}
for (var drumOrd=0;drumOrd<drumButtons.length;drumOrd++) {
drumButtons[drumOrd].addEventListener("click",function (event) {
var drumButton=event.target;
playSound(drumButton);
buttonAnimation(drumButton);
});
}
window.addEventListener("keydown",function (event) {
if (drumButtonLetters.includes(event.key)) {
var drumButton=document.querySelector("."+event.key+".drum")
playSound(drumButton);
buttonAnimation(drumButton);
}
});
|
import React, { useState, useEffect, useContext } from "react";
import ColorContext from "../../contexts/ColorContext";
const getTime = () => new Date().toLocaleTimeString();
function Clock() {
const [time, setTime] = useState(getTime());
const color = useContext(ColorContext);
useEffect(() => {
const intervalID = setInterval(() => {
setTime(getTime());
}, 1000);
return () => {
clearInterval(intervalID);
};
}, []);
return <h3 style={{ color: color }}>My Time: {time}</h3>;
}
export default Clock;
|
const selectImage = document.querySelectorAll("[data-src]");
const imageOptions = {
root: null,
threshold: 1,
rootMargin: "200px"
};
function preloadImage(img) {
const src = img.getAttribute("data-src");
if (!src) {
return;
}
img.src = src;
}
const imgObserver = new IntersectionObserver(function (enteries, imgObserver) {
enteries.forEach(entry => {
if (!entry.isIntersecting) {
return;
}
preloadImage(entry.target);
imgObserver.unobserve(entry.target);
});
}, imageOptions);
selectImage.forEach(image => {
imgObserver.observe(image);
});
// Product-images
// var productImg = document.getElementById("productImage");
// var smallImg = document.getElementsByClassName("smallImage");
// smallImg[0].onclick = function () {
// productImg.src = smallImg[0].src;
// }
// smallImg[1].onclick = function () {
// productImg.src = smallImg[1].src;
// }
// smallImg[2].onclick = function () {
// productImg.src = smallImg[2].src;
// }
// smallImg[3].onclick = function () {
// productImg.src = smallImg[3].src;
// }
//Cart Item
const btn = document.querySelector(".shop-item-button");
const overlay = document.querySelector(".cart-1");
btn.addEventListener('click', function () {
overlay.classList.remove("hidden-class");
document.querySelector(".cart-overlay").classList.remove("hidden-class");
document.querySelector(".content").classList.remove("hidden-class");
})
|
// kinect
var _ = function(){};
_.removeFromArray = function(array, item) {
var index = array.indexOf(item);
if (index > -1) {
array.splice(index, 1);
}
};
var usedids = [];
function loaded() {
var u = 0;
var radardiv = $('#radar')[0];
var radar = {
onuserfound: function (user) {
var userdiv = document.createElement('div');
userdiv.className = 'user';
user.radarelement = userdiv; // add the radarelement property to the user object
radardiv.appendChild(user.radarelement);
u++; //increment each time new user is found
$("#total span").html(u); //tell us how many users
// get thoughts via json file
var newfound = null;
var thought = null;
// var newfoundtotal = 0;
function getthought() {
for (i=0; i < tobeprojected.length; i++) {
var item = tobeprojected[i].id;
if (usedids.indexOf(item) == -1) {
newfound = tobeprojected[i];
console.log('new' +newfound);
break;
}
}
if (newfound) {
thought = newfound.thoughttext;
socket.emit('huey', newfound.id);
usedids.push(newfound.id);
// $('#alert').html('<span class="newfoundtotal">'+newfoundtotal+'</span>');
newfound = null;
}
else {
if (tobeprojected.length > 0 ){
var randomthought = Math.round(Math.random() * (tobeprojected.length-1));
thought = tobeprojected[randomthought].thoughttext;
}
}
}
if (currentprojected[1].thought == null ){
getthought();
}
else {
var toberemoved = [];
for (i=0; i < tobeprojected.length; i++) {
var item = tobeprojected[i].id;
if (currentprojected[1].thought == item){
toberemoved.push(tobeprojected[i]);
}
}
for (i=0; i < toberemoved.length; i++) {
_.removeFromArray(tobeprojected, toberemoved[i]);
}
getthought();
}
var wrapper = '<li id="uuid'+user.id+'"><div class="th" style="z-index:'+(100000+u)+'"><p>'+thought+'</p></div><iframe src="bubbles/medium.html" allowTransparency="true" scrolling="no" style="z-index:'+(99999+u)+'"></iframe></li>';
$("#blur").append((wrapper));
},
onuserlost: function (user) {
$("#uuid"+user.id+" iframe").addClass("fadeitout").delay(4100).queue(function() {
$(this).remove();
// $(this).dequeue();
});
$("#uuid"+user.id +" .th").delay(800).addClass("fade");
radardiv.removeChild(user.radarelement);
timer = 0;
},
ondataupdate: function (zigdata) {
for (var userid in zigdata.users) {
var user = zigdata.users[userid];
var pos = user.position;
var el = user.radarelement;
var parentElement = el.parentNode;
var zrange = 8000;
var xrange = 8000;
var pixelwidth = parentElement.offsetWidth;
var pixelheight = parentElement.offsetHeight;
var heightscale = pixelheight / zrange;
var widthscale = pixelwidth / xrange;
el.style.left = (((pos[0] / xrange) + 0.5) * pixelwidth - (el.offsetWidth / 2)) + "px";
el.style.top = ((pos[2] / zrange) * pixelheight - (el.offsetHeight / 2)) + "px";
var ypos = user.skeleton[zig.Joint.Head].position[1];
var xpos = user.skeleton[zig.Joint.Head].position[0];
var zpos = user.skeleton[zig.Joint.Head].position[2];
var yfactor = 1400;
var xfactor = null;
var zfactor = 4000;
console.log(zpos);
// x factor -- reset coordinates to absolute positioning
if (xpos < 0) {
xfactor = (Math.abs(xpos)) + 1450
} else {
xfactor = Math.abs(xpos-1450)
}
yfactor = ((zpos-4600)/2000)*-100;
// create some blur
// (ypos < 0) ? ypos = ypos * -1 : ypos = ypos * 2;
// (xpos < 0) ? xpos = xpos * -1 : xpos = xpos * 2;
//console.log(yfactor);
//str = str.substring(0, str.length - 2);
//console.log(blurfactor*.1);
var blurfactor = (yfactor * .1);
console.log(blurfactor);
var amt = "-webkit-filter:blur("+blurfactor*.1+"px)";
var ycoord = "top:" +(yfactor-20)+"%; ";
var xcoord = "left:" + ((xfactor / 3400) * 100) +"%; ";
//console.log(xcoord);
var coords = "position: absolute; " + ycoord + xcoord + "-webkit-filter:blur("+(blurfactor-2)*.7+"px)";
$("#uuid"+user.id+" iframe").attr("style", amt)
$("#uuid"+user.id).attr("style", coords);
}
}
};
zig.verbose = true;
zig.addListener(radar);
updatenotification();
}
function updatenotification() {
var total = 0;
for (i=0; i < tobeprojected.length; i++) {
var item = tobeprojected[i].id;
if (usedids.indexOf(item) == -1) {
total++;
}
}
$('#alert').html('<span class="newfoundtotal">'+total+'</span>');
setTimeout(function() {
updatenotification();
}, 10000);
}
document.addEventListener('DOMContentLoaded', loaded, false);
|
/// <reference types="cypress" />
import homePage from '../page-objects/homePage'
import bostonHomePage from '../page-objects/bostonHomePage'
import bostonAllInclusive from '../page-objects/bostonAllInclusivePage'
import reviewOrder from '../page-objects/reviewOrder'
const homepage = new homePage()
const bostonhomepage = new bostonHomePage()
const bostonAllInclusivePass = new bostonAllInclusive()
const revieworder = new reviewOrder()
describe('End to End Journey of Go Boston Pass', () => {
before(() => homepage.navigateToHomePage())
beforeEach(() => {
Cypress.on('uncaught:exception', (err, runnable) => {
// returning false here prevents Cypress from
// failing the test
return false
})
//open eyes session to appear on AppliTools
cy.eyesOpen
({
appName: 'Go City Boston', batchName: 'Go City Boston All Inclusive!',
browser: [
{ name: 'chrome', width: 1024, height: 768 },
{ name: 'chrome', width: 800, height: 600 },
{ name: 'firefox', width: 1024, height: 768 },
{ deviceName: 'iPhone X' },
]
})
cy.injectAxe();
})
afterEach(() => cy.eyesClose())
it('Validate home page', () => {
homepage.homePageTitle('Go City ')
cy.eyesCheckWindow('Go City Home page')
//Capture Accessibility issues earlier on, if any
//only include rules with serious and critical impacts
cy.checkA11y(null, { includedImpacts: ['critical', 'serious'] });
})
it.skip('Find city from List of Destination', () => {
homepage.searchDestination('Boston')
})
it('Validate Boston page', () => {
bostonhomepage.navigateToBostonPage()
bostonhomepage.verifyBostonPage('Go Boston Pass | Attraction Pass')
cy.eyesCheckWindow('Boston home page')
//Validate accessibility on the page
//only include rules with serious and critical impacts
cy.checkA11y(null, { includedImpacts: ['critical', 'serious'] });
//Choose Boston All Inclusive pass
bostonhomepage.bostonPassAllInclusive()
})
it('Validate Accessibility on Boston All-Inclusive Pass page', () => {
bostonAllInclusivePass.navigateToBostonAllInclusive()
//only include rules with serious and critical impacts
cy.checkA11y(null, { includedImpacts: ['critical', 'serious'] });
})
it('Choose your pass - Boston All Inclusive journey', () => {
bostonAllInclusivePass.navigateToBostonAllInclusive()
//Select from dropdown list - chosen 3rd item
bostonAllInclusivePass.dayPass('5 day pass from $147')
bostonAllInclusivePass.verifyCheckOutButtonDisabled()
//Increment by one for an Adult and a Child to validate increment
bostonAllInclusivePass.AdultCartItemIncrease()
bostonAllInclusivePass.adultAmountValue('1')
bostonAllInclusivePass.ChildCartItemIncrease()
bostonAllInclusivePass.childAmountValue('1')
cy.eyesCheckWindow('Boston All inclusive page')
//Select the Shopping Cart Icon to verify
bostonAllInclusivePass.OrderTotalValue('258')
bostonAllInclusivePass.shoppingBasketCounter('2')
bostonAllInclusivePass.shoppingBasketOpen()
bostonAllInclusivePass.verifyShoppingCardOrderTotal('258')
//Click on the Shopping Cart button within
bostonAllInclusivePass.shoppingCartCheckoutButton()
revieworder.adultCartChosen('5 day pass Adult All-Inclusive')
revieworder.childCartChosen('5 day pass Child (3–12) All-Inclusive')
revieworder.totalValue('258')
cy.eyesCheckWindow('Review Order page')
})
it('Validate Accessibility on Review Order page', () => {
revieworder.navigateToReviewOrder()
//only include rules with serious and critical impacts
cy.checkA11y(null, { includedImpacts: ['critical', 'serious'] });
})
})
|
#!/usr/bin/env node
const fs = require('fs');
const _ = require('lodash');
const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
const deps = _.keys(pkg.dependencies);
const devDeps = _.keys(pkg.devDependencies)
const overlap = _.intersection(deps, devDeps);
if (overlap.length > 0) {
console.error("duplicate dev and regular deps", overlap);
}
const depsCmd = "npm install --save " + deps.join(" ");
const devDepsCmd = "npm install --save-dev " + devDeps.join(" ");
console.log("# install deps:");
console.log(depsCmd);
console.log("");
console.log("# install dev deps:");
console.log(devDepsCmd);
|
$(document).ready(function() {
$('h1').on('click', test);
})
const test = function() {
$(this).css('color', 'red');
};
|
import {
DEVICE_PIN_INPUT_UPDATE,
DEVICE_PIN_INPUT_REMOVE,
USER_LOGIN_SUCCESS,
USER_LOGOUT
} from './data.actionType'
import { devicePinUpdate } from './data.actions';
const initialState = {
userLogin: false,
devicePin: ['','', '', '', '', '']
}
const reducers = (state=initialState, action) => {
switch (action.type) {
case DEVICE_PIN_INPUT_UPDATE:
return {
...state,
devicePin: action.payload
}
case DEVICE_PIN_INPUT_REMOVE:
return initialState
case USER_LOGIN_SUCCESS:
return {
...state,
userLogin: true
}
case USER_LOGOUT:
return {
...state,
userLogin: false
}
default:
return state
}
}
export default reducers
|
import React from "react";
import ChatWindow from "./ChatWindow";
class MainPanel extends React.Component {
render() {
return (
<div className="MainPanel-Element">
<ChatWindow
groupName={this.props.groupName}
groupId={this.props.groupId}
userId={this.props.userId}
/>
</div>
);
}
}
export default MainPanel;
|
import { request } from "http";
export class Douban {
async login(user, pass){
request
}
}
|
import ExpenseDate from "./ExpenseDate.js";
import "./ExpenseItem.css";
import Card from "../UI/Card.js";
import React from "react";
function ExpenseItem(props) {
return (
<Card className="componentContainer">
<ExpenseDate date={props.date} />
<div className="title-amount">
<h2 className="title">{props.title}</h2>
<p className="amount">${props.amount}</p>
</div>
</Card>
);
}
export default ExpenseItem;
|
import React, { Component } from 'react';
/**
* -------------------------------------------
ARCHIVOS PARA EL LA CONEXION DE
* -------------------------------------------
*/
import { Route, Router, Switch } from 'react-router'
import Home from '../views/Home'
import PropTypes from 'prop-types'
import DocumentoDetail from '../views/DocsDetail'
import FormData from '../views/FormularioData'
import Inicio from '../views/Inicio'
import Buscar from '../buscar/BUSCAR'
/**
-----------------------------
LOGIN CON EL API REST
-------------------------------
*/
import { getCurrentUser } from '../util/APIUtils';
import { ACCESS_TOKEN } from '../constants';
import Login from '../user/login/Login';
import inicio_sesion from '../user/login/iniciar_sesion'
import registro_usuario from '../user/login/registro_usuario'
import Signup from '../user/signup/Signup';
import LoadingIndicator from '../actions/LoadingIndicator';
import { Layout, notification } from 'antd';
const { Content } = Layout;
/**
* -------------------
* FIN DE LO AGREGADO
* -------------------
* */
class App extends Component {
constructor(props) {
super(props);
this.state = {
currentUser: null,
isAuthenticated: false,
isLoading: false
}
this.handleLogout = this.handleLogout.bind(this);
this.loadCurrentUser = this.loadCurrentUser.bind(this);
this.handleLogin = this.handleLogin.bind(this);
notification.config({
placement: 'topRight',
top: 70,
duration: 3,
});
}
loadCurrentUser() {
this.setState({
isLoading: true
});
getCurrentUser()
.then(response => {
this.setState({
currentUser: response,
isAuthenticated: true,
isLoading: false
});
}).catch(error => {
this.setState({
isLoading: false
});
});
}
componentDidMount() {
this.loadCurrentUser();
}
handleLogout(redirectTo = "/", notificationType = "success", description = "Cerro sesion satisfactoriamente") {
localStorage.removeItem(ACCESS_TOKEN);
this.setState({
currentUser: null,
isAuthenticated: false
});
this.props.history.push(redirectTo);
notification[notificationType]({
message: 'Integrador CMS',
banner:true,
description: description,
});
}
handleLogin() {
notification.success({
message: 'Integrador CMS',
description: "Inicio sesion satisfactoriamente.",
});
this.loadCurrentUser();
this.props.history.push("/home");
}
render() {
if (this.state.isLoading) {
return <LoadingIndicator />
}
return (
<Layout className="app-container">
<Router history={this.props.history}>
<div className="App">
<Content>
<Switch>
<Route exact path="/" component={Inicio} />
<Route exact path="/home" component={Home} />
{/* se elimo solamente sera un componente */}
{/* <Route path="/nav" component={Nav}/> */}
{/* fin del nav */}
<Route path="/detail/:docuId" component={DocumentoDetail} />
<Route path="/subirDocs" component={FormData} />
<Route path="/buscar" component={Buscar} />
<Route path="/orlando" component={inicio_sesion} />
<Route path="/camavilca" component={registro_usuario} />
{/* <Route exact path="/login" component={ Login }/> */}
<Route path="/login" render={(props) => <Login onLogin={this.handleLogin} {...props} />} />
<Route path="/signup" component={Signup} />
{/* <Route path="/home" component={ Home }/> */}
{/* <Route component={NotFun} /> */}
</Switch>
</Content>
</div>
</Router>
</Layout>
);
}
}
App.propTypes = {
history: PropTypes.any.isRequired
}
export default App;
|
OC.L10N.register(
"settings",
{
"Share" : "هاوبەشی کردن",
"Invalid request" : "داواکارى نادروستە",
"All" : "هەمووی",
"Enable" : "چالاککردن",
"None" : "هیچ",
"Save" : "پاشکهوتکردن",
"Login" : "چوونەژوورەوە",
"Encryption" : "نهێنیکردن",
"Server address" : "ناونیشانی ڕاژه",
"Add" : "زیادکردن",
"Cancel" : "لابردن",
"Email" : "ئیمهیل",
"Password" : "وشەی تێپەربو",
"New password" : "وشەی نهێنی نوێ",
"Name" : "ناو",
"Username" : "ناوی بهکارهێنهر",
"Admin" : "بهڕێوهبهری سهرهكی",
"Settings" : "ڕێکخستنهکان"
},
"nplurals=2; plural=(n != 1);");
|
// 引入React
import React,{Component} from 'react';
import TodoItem from './TodoItem';
class TodoContent extends Component{
render(){
let {data,handlerRemove,handlerComplete} = this.props
return (
<table className="table table-striped">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">内容</th>
<th scope="col">是否完成</th>
<th scope="col">操作</th>
</tr>
</thead>
<tbody>
{
data.map((item,idx)=><TodoItem key={idx}
data={item}
idx={idx}
handlerComplete={handlerComplete}
handlerRemove={handlerRemove}
/>)
}
</tbody>
</table>
)
}
}
export default TodoContent;
|
/*
The following iterative sequence is defined
for the set of positive integers:
n -> n/2 (n is even)
n -> 3n + 1 (n is odd)
Using the rule above and starting with 13,
we generate the following sequence:
13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1
It can be seen that this sequence (starting at 13 and finishing at 1) contains
10 terms. Although it has not been proved yet (Collatz Problem), it is thought
that all starting numbers finish at 1.
Which starting number, under one million, produces the longest chain?
NOTE: Once the chain starts the terms are allowed to go above one million.
*/
var helper = require('./helper.js'),
num = 1000000,
result = [0, 0],
len;
function collatz(num, count) {
return num === 1 ? count : (num % 2 === 0) ?
collatz(num / 2, count + 1) :
collatz(3 * num + 1, count + 1);
}
while (--num) {
len = collatz(num, 0);
if (len > result[1]) {
result = [num, len];
}
}
helper(result[0]);
|
var fs = require('fs');
//path = './graph.gv';
function print(states, path) {
//create all.js
if (fs.exists(path)) fs.unlinkSync(path);
var f = fs.openSync(path, 'w+');
fs.appendFileSync(path, 'digraph G {');
fs.appendFileSync(path, '\n');
for (var i = 0; i < states.length; i++) {
fs.appendFileSync(path, states[i].sid + '_' + states[i].name + ';');
fs.appendFileSync(path, '\n');
if (states[i].parents.length) {
for (var j = 0; j < states[i].parents.length; j++) {
var link = states[i].parents[j].sid + '_' + states[i].parents[j].name + ' -> ' + states[i].sid + '_' + states[i].name + ' ; ';
fs.appendFileSync(path, link);
fs.appendFileSync(path, '\n');
};
};
};
fs.appendFileSync(path, '}');
fs.appendFileSync(path, '\n');
};
module.exports.print = print;
|
import React from "react"
import PropTypes from "prop-types"
import credentials from "../../data/resumeContent"
import Layout from "../../components/layout"
const {
tagLine,
webdevExperience,
technicalSkills,
essentialSkills,
education,
communityContributions,
personalInterests,
contactInformation,
} = credentials
// Can use this for shorter resume, rather than CV
const MAX_NUMBER_RECENT_EXPERIENCE = 6
export default function ResumePage({ location }) {
return (
<Layout location={location} includeHeader={false}>
<h1 style={{ marginTop: 10, marginBottom: 15 }}>Christian Danielsen</h1>
<p>{tagLine}</p>
{/*
TECHNICAL SKILLS
*/}
<h3>Technical Skills & Experience</h3>
{technicalSkills.map(({ label, content }, idx) => (
<p key={idx}>
<strong>{label}</strong>
<br />
{content.join(", ")}
</p>
))}
{/*
ESSENTIAL SKILLS
*/}
<h3>Essential Human / Developer Skills</h3>
<ul>
{essentialSkills.map((essentialSkill, idx) => (
<li key={idx}>{essentialSkill}</li>
))}
</ul>
{/*
DEV EXPERIENCE
*/}
<h3>Development Experience</h3>
{webdevExperience
.map((role, idx) => (
<div key={idx}>
<strong>
{role.title} - {role.company}
</strong>
<br />
<em>
{role.location} ({role.startDate} - {role.endDate})
</em>
<ul>
{role.highlights.map((highlight, idx) => {
return (
<li key={idx} className="resume__experience__item">
{highlight}
</li>
)
})}
</ul>
</div>
))
.slice(0, MAX_NUMBER_RECENT_EXPERIENCE)}
{/*
EDUCATION & TRAINING
*/}
<h3 className="resume__education-training__header">
Education & Training
</h3>
{[
...education.sort(
({ date: nextDate }, { date: currentDate }) => currentDate - nextDate
),
].map(({ date, duration, institution, location, title }, idx) => (
<p key={idx + title} className="resume__education-training__item">
{date} - {title}
{duration ? ` (${duration})` : ""}, {institution}, {location}
</p>
))}
{/*
COMMUNITY CONTRIBUTIONS
*/}
<h3 className="resume__contributions__header">Community Contributions</h3>
{communityContributions.map(
({ role, title, location, description, year }) => (
<>
<p key={title} className="resume__contributions__item">
<strong>
{role}, {title} ({year} - {location})
</strong>
<br />
{description}
</p>
</>
)
)}
{/*
PERSONAL INTERESTS
*/}
<h3 className="resume__personal__header">Personal Interests</h3>
<p className="resume__personal__item">{personalInterests.join(" | ")}</p>
{/*
CONTACT
*/}
<h3 className="resume__personal__header">Contact</h3>
<p className="resume__personal__item">{contactInformation.join(" | ")}</p>
</Layout>
)
}
ResumePage.propTypes = {
location: PropTypes.object.isRequired,
}
|
import React from "react";
import { connect } from "react-redux";
import { Typography, JackpotPotIcon } from "components";
import { getApp, getIcon } from "../../lib/helpers";
import { formatCurrency } from '../../utils/numberFormatation';
import _ from 'lodash';
import coinPng from 'assets/coin.png';
import './index.css';
class JackpotPot extends React.Component{
constructor(props){
super(props);
this.state = {
pot: 0,
currencyImage: null
}
}
componentDidMount(){
this.projectData(this.props)
}
componentWillReceiveProps(props){
this.projectData(props);
}
projectData = async (props) => {
const { profile, currency } = props;
if(profile && !_.isEmpty(profile)){
const appWallet = getApp().wallet.find(w => w.currency._id === currency._id);
const res = await profile.getJackpotPot({ currency_id: currency._id });
if(!_.isEmpty(appWallet) && !_.isEmpty(currency)) {
this.setState({
currencyImage: _.isEmpty(appWallet.image) ? currency.image : appWallet.image,
pot: res ? res.pot : 0
});
}
}
}
render(){
const { pot, currencyImage } = this.state;
const jackpotPotIcon = getIcon(5);
if(pot == 0) { return null };
return (
<div styleName="box">
<div styleName="box-1" style={{ background: 'url('+coinPng+')', backgroundPosition: "right center", backgroundSize: "auto 85%", backgroundRepeat: "no-repeat"}}>
<div styleName="root">
<div styleName="main">
<div styleName="icon">
{ jackpotPotIcon === null ? <JackpotPotIcon /> : <img src={jackpotPotIcon} /> }
<div styleName="text">
<Typography variant={'h4'} color={'white'} weight={"bold"}>
JACKPOT
</Typography>
<Typography variant={'x-small-body'} color={'white'}>
Bet to gain the possibility of taking the jackpot home!
</Typography>
</div>
</div>
<div styleName="right">
<div styleName="value">
<img src={currencyImage} width={"24"} heigth={"24"}/>
<Typography variant={'h4'} color={'white'} weight={"bold"}>
{formatCurrency(pot)}
</Typography>
</div>
</div>
</div>
</div>
</div>
</div>
)
}
}
function mapStateToProps(state){
return {
profile : state.profile,
ln: state.language,
currency: state.currency
};
}
export default connect(mapStateToProps)(JackpotPot);
|
import DataStore from 'flux/stores/DataStore.js';
import Slide from './Slide.js';
import Sidelink from './Sidelink.js';
class Home extends React.Component {
render() {
//let allData = DataStore.getAll();
let homeMenu = DataStore.getMenuBySlug('homepage');
homeMenu = _.sortBy(homeMenu, [function(page) { return page.menu_order; }]);
return (
<div>
<div id="homepage">
{homeMenu.map((page, i) => {
if(page.slug){
var section = DataStore.getPageBySlug(page.slug);
//console.log(section);
return(
<Slide items={section} />
)
}
})}
</div>
<div id="side-nav">
<ul>
{homeMenu.map((page, i) => {
if(page.slug && page.slug != 'home'){
return(
<Sidelink items={page} />
)
}
})}
</ul>
</div>
</div>
);
}
}
export default Home;
|
/**
* @license
* Copyright 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
describe('Player', function() {
var Util;
var onErrorSpy;
var Feature;
/** @type {shakaExtern.SupportType} */
var support;
/** @type {!HTMLVideoElement} */
var video;
/** @type {shaka.Player} */
var player;
/** @type {shaka.util.EventManager} */
var eventManager;
var shaka;
beforeAll(function(done) {
video = /** @type {!HTMLVideoElement} */ (document.createElement('video'));
video.width = 600;
video.height = 400;
video.muted = true;
document.body.appendChild(video);
// Load test utils from outside the compiled library.
Util = window.shaka.test.Util;
// Load asset features from outside the compiled library.
Feature = window.shakaAssets.Feature;
var loaded = window.shaka.util.PublicPromise();
if (getClientArg('uncompiled')) {
// For debugging purposes, use the uncompiled library.
shaka = window.shaka;
loaded.resolve();
} else {
// Load the compiled library as a module.
// All tests in this suite will use the compiled library.
require(['/base/dist/shaka-player.compiled.js'], function(shakaModule) {
shaka = shakaModule;
shaka.net.NetworkingEngine.registerScheme(
'test', window.shaka.test.TestScheme);
shaka.media.ManifestParser.registerParserByMime(
'application/x-test-manifest',
window.shaka.test.TestScheme.ManifestParser);
loaded.resolve();
});
}
loaded.then(function() {
return window.shaka.test.TestScheme.createManifests(shaka, '_compiled');
}).then(function() {
return shaka.Player.probeSupport();
}).then(function(supportResults) {
support = supportResults;
done();
});
});
beforeEach(function() {
player = new shaka.Player(video);
// Grab event manager from the uncompiled library:
eventManager = new window.shaka.util.EventManager();
onErrorSpy = jasmine.createSpy('onError');
onErrorSpy.and.callFake(function(event) { fail(event.detail); });
eventManager.listen(player, 'error', onErrorSpy);
});
afterEach(function(done) {
Promise.all([
eventManager.destroy(),
player.destroy()
]).catch(fail).then(done);
});
afterAll(function() {
document.body.removeChild(video);
});
describe('getStats', function() {
it('gives stats about current stream', function(done) {
// This is tested more in player_unit.js. This is here to test the public
// API and to check for renaming.
player.load('test:sintel_compiled').then(function() {
video.play();
return waitUntilPlayheadReaches(video, 1, 10);
}).then(function() {
var stats = player.getStats();
var expected = {
width: jasmine.any(Number),
height: jasmine.any(Number),
streamBandwidth: jasmine.any(Number),
decodedFrames: jasmine.any(Number),
droppedFrames: jasmine.any(Number),
estimatedBandwidth: jasmine.any(Number),
loadLatency: jasmine.any(Number),
playTime: jasmine.any(Number),
bufferingTime: jasmine.any(Number),
// We should have loaded the first Period by now, so we should have a
// history.
switchHistory: jasmine.arrayContaining([{
timestamp: jasmine.any(Number),
id: jasmine.any(Number),
// Include 'window' to use uncompiled version version of the
// library.
type: window.shaka.util.ManifestParserUtils.ContentType.VIDEO,
fromAdaptation: true
}]),
stateHistory: jasmine.arrayContaining([{
state: 'playing',
timestamp: jasmine.any(Number),
duration: jasmine.any(Number)
}])
};
expect(stats).toEqual(expected);
}).catch(fail).then(done);
});
});
describe('setTextTrackVisibility', function() {
// Using mode='disabled' on TextTrack causes cues to go null, which leads
// to a crash in TextEngine. This validates that we do not trigger this
// behavior when changing visibility of text.
it('does not cause cues to be null', function(done) {
var textTrack = video.textTracks[0];
player.load('test:sintel_compiled').then(function() {
video.play();
return waitUntilPlayheadReaches(video, 1, 10);
}).then(function() {
// This should not be null initially.
expect(textTrack.cues).not.toBe(null);
player.setTextTrackVisibility(true);
// This should definitely not be null when visible.
expect(textTrack.cues).not.toBe(null);
player.setTextTrackVisibility(false);
// This should not transition to null when invisible.
expect(textTrack.cues).not.toBe(null);
}).catch(fail).then(done);
});
});
describe('plays', function() {
it('while external text tracks', function(done) {
player.load('test:sintel_no_text_compiled').then(function() {
// For some reason, using path-absolute URLs (i.e. without the hostname)
// like this doesn't work on Safari. So manually resolve the URL.
var locationUri = new goog.Uri(location.href);
var partialUri = new goog.Uri('/base/test/test/assets/text-clip.vtt');
var absoluteUri = locationUri.resolve(partialUri);
player.addTextTrack(absoluteUri.toString(), 'en', 'subtitles',
'text/vtt');
video.play();
return Util.delay(5);
}).then(function() {
var textTracks = player.getTextTracks();
expect(textTracks).toBeTruthy();
expect(textTracks.length).toBe(1);
expect(textTracks[0].active).toBe(true);
expect(textTracks[0].language).toEqual('en');
}).catch(fail).then(done);
});
it('while changing languages with short Periods', function(done) {
// See: https://github.com/google/shaka-player/issues/797
player.configure({preferredAudioLanguage: 'en'});
player.load('test:sintel_short_periods_compiled').then(function() {
video.play();
return waitUntilPlayheadReaches(video, 8, 30);
}).then(function() {
// The Period changes at 10 seconds. Assert that we are in the previous
// Period and have buffered into the next one.
expect(video.currentTime).toBeLessThan(9);
expect(video.buffered.end(0)).toBeGreaterThan(11);
// Change to a different language; this should clear the buffers and
// cause a Period transition again.
expect(getActiveLanguage()).toBe('en');
player.selectAudioLanguage('es');
return waitUntilPlayheadReaches(video, 21, 30);
}).then(function() {
// Should have gotten past the next Period transition and still be
// playing the new language.
expect(getActiveLanguage()).toBe('es');
}).catch(fail).then(done);
});
window.shakaAssets.testAssets.forEach(function(asset) {
if (asset.disabled) return;
var testName =
asset.source + ' / ' + asset.name + ' : ' + asset.manifestUri;
var wit = asset.focus ? fit : external_it;
wit(testName, function(done) {
if (asset.drm.length && !asset.drm.some(
function(keySystem) { return support.drm[keySystem]; })) {
pending('None of the required key systems are supported.');
}
var mimeTypes = [];
if (asset.features.indexOf(Feature.WEBM) >= 0)
mimeTypes.push('video/webm');
if (asset.features.indexOf(Feature.MP4) >= 0)
mimeTypes.push('video/mp4');
if (!mimeTypes.some(
function(type) { return support.media[type]; })) {
pending('None of the required MIME types are supported.');
}
var isLive = asset.features.indexOf(Feature.LIVE) >= 0;
var config = { abr: {}, drm: {}, manifest: { dash: {} } };
config.abr.enabled = false;
config.manifest.dash.clockSyncUri =
'//shaka-player-demo.appspot.com/time.txt';
if (asset.licenseServers)
config.drm.servers = asset.licenseServers;
if (asset.drmCallback)
config.manifest.dash.customScheme = asset.drmCallback;
if (asset.clearKeys)
config.drm.clearKeys = asset.clearKeys;
player.configure(config);
if (asset.licenseRequestHeaders) {
player.getNetworkingEngine().registerRequestFilter(
addLicenseRequestHeaders.bind(null, asset.licenseRequestHeaders));
}
var networkingEngine = player.getNetworkingEngine();
if (asset.requestFilter)
networkingEngine.registerRequestFilter(asset.requestFilter);
if (asset.responseFilter)
networkingEngine.registerResponseFilter(asset.responseFilter);
if (asset.extraConfig)
player.configure(asset.extraConfig);
player.load(asset.manifestUri).then(function() {
expect(player.isLive()).toEqual(isLive);
video.play();
// 30 seconds or video ended, whichever comes first.
return waitForTimeOrEnd(video, 30);
}).then(function() {
if (video.ended) {
expect(video.currentTime).toBeCloseTo(video.duration, 1);
} else {
expect(video.currentTime).toBeGreaterThan(20);
// If it were very close to duration, why !video.ended?
expect(video.currentTime).not.toBeCloseTo(video.duration);
if (!player.isLive()) {
// Seek and play out the end.
video.currentTime = video.duration - 15;
// 30 seconds or video ended, whichever comes first.
return waitForTimeOrEnd(video, 30).then(function() {
expect(video.ended).toBe(true);
expect(video.currentTime).toBeCloseTo(video.duration, 1);
});
}
}
}).catch(fail).then(done);
});
});
/**
* Gets the language of the active Variant.
* @return {string}
*/
function getActiveLanguage() {
var tracks = player.getVariantTracks().filter(function(t) {
return t.active;
});
expect(tracks.length).toBeGreaterThan(0);
return tracks[0].language;
}
});
/**
* @param {!HTMLMediaElement} video
* @param {number} playheadTime The time to wait for.
* @param {number} timeout in seconds, after which the Promise fails
* @return {!Promise}
*/
function waitUntilPlayheadReaches(video, playheadTime, timeout) {
var curEventManager = eventManager;
return new Promise(function(resolve, reject) {
curEventManager.listen(video, 'timeupdate', function() {
if (video.currentTime >= playheadTime) {
curEventManager.unlisten(video, 'timeupdate');
resolve();
}
});
Util.delay(timeout).then(function() {
curEventManager.unlisten(video, 'timeupdate');
reject('Timeout waiting for time');
});
});
}
/**
* @param {!EventTarget} target
* @param {number} timeout in seconds, after which the Promise succeeds
* @return {!Promise}
*/
function waitForTimeOrEnd(target, timeout) {
var curEventManager = eventManager;
return new Promise(function(resolve, reject) {
var callback = function() {
curEventManager.unlisten(target, 'ended');
resolve();
};
curEventManager.listen(target, 'ended', callback);
Util.delay(timeout).then(callback);
});
}
/**
* @param {!Object.<string, string>} headers
* @param {shaka.net.NetworkingEngine.RequestType} requestType
* @param {shakaExtern.Request} request
*/
function addLicenseRequestHeaders(headers, requestType, request) {
var RequestType = shaka.net.NetworkingEngine.RequestType;
if (requestType != RequestType.LICENSE) return;
// Add these to the existing headers. Do not clobber them!
// For PlayReady, there will already be headers in the request.
for (var k in headers) {
request.headers[k] = headers[k];
}
}
});
|
requirejs.config({
baseUrl: "js"
// 发现一个秘密:如果js文件是在baseUrl路径下的,可以不定义path路径,也能被引用
});
requirejs(["returnFunction"], function( rf ) {
rf("自定义参数");
console.log("Success!");
});
|
import React from 'react'
import './Aside.css'
import { Menu } from 'antd'
import { AppstoreOutlined, MailOutlined } from '@ant-design/icons'
const { SubMenu } = Menu
const list = [
{ value: '1', label: '云主机' },
{ value: '2', label: '裸机' },
{ value: '3', label: '镜像' },
{ value: '4', label: '云硬盘' },
{ value: '5', label: '备份' },
{ value: '6', label: '快照' },
{ value: '7', label: '路由器' },
{ value: '8', label: '浮动IP' },
{ value: '9', label: 'VPN' },
]
const list2 = [
{ value: '10', label: '防火墙' },
{ value: '11', label: '负载均衡器' },
{ value: '12', label: '对象储存' },
{ value: '13', label: '网络' },
]
function handleClick (e) {
console.log('click ', e)
};
function Aside (props) {
const { dragreStart } = props
return (
<Menu
onClick={handleClick}
style={{ width: 256, height: '100vh' }}
defaultSelectedKeys={['1']}
defaultOpenKeys={['sub1']}
mode="inline"
className="aside"
>
<SubMenu key="sub1" icon={<MailOutlined />} title="Navigation One">
{
list.map(item => (<Menu.Item className="dragItem" key={item.value} draggable onDragStart={dragreStart.bind(this, item)}>{item.label}</Menu.Item>))
}
</SubMenu>
<SubMenu key="sub2" icon={<AppstoreOutlined />} title="Navigation Two">
{
list2.map(item => (<Menu.Item className="dragItem" key={item.value} draggable onDragStart={dragreStart.bind(this, item)}>{item.label}</Menu.Item>))
}
</SubMenu>
</Menu>
)
}
export default Aside
|
import React, { Component } from 'react'
import PropTypes from 'prop-types'
class DocsDetailBody extends Component {
render(){
const { archivo } = this.props;
return(
<div className="DocsDetailBody">
<div>
{ archivo }
</div>
</div>
)
}
}
DocsDetailBody.propTypes = {
archivo: PropTypes.string.isRequired
}
export default DocsDetailBody;
|
$(function() {
collapse('#collapse-open', '.glyphicon-collapse-open');
collapse('#collapse-progress', '.glyphicon-collapse-progress');
collapse('#collapse-complete', '.glyphicon-collapse-complete');
collapse('#collapse-recur', '.glyphicon-collapse-recur');
});
function collapse(master, detail) {
$(master).click(function() {
$(detail).click();
$(this).toggleClass("glyphicon-chevron-down").toggleClass("glyphicon-chevron-up");
});
$(detail).click(function() {
$(this).toggleClass("glyphicon-chevron-down").toggleClass("glyphicon-chevron-up");
});
}
|
'use strict'
let FacebookStrategy = require('passport-facebook').Strategy
let User = require('../models/users')
let fb = require('fb')
module.exports = (passport) => {
passport.use('facebook', new FacebookStrategy({
clientID: '323023344746285',
clientSecret: 'ebdb4703aed8f6812d51be129cef8ce2',
callbackURL: 'http://localhost:8081/login/facebook/return',
profileFields: ['id', 'name', 'link', 'about', 'email']
},
// facebook will send back the tokens and profile
(access_token, refresh_token, profile, done) => {
//console.log('profile', profile)
process.nextTick(() => {
fb.api('/687797544718797/members?access_token=' + access_token, (response) => {
if (response.error) return done(response.error)
if (response) {
let exists = false
response.data.forEach((user) => {
if (user.id == profile.id) {
exists = true
fb.api('/' + user.id + '/picture?redirect=0', function(response) {
if (response.error) console.log(response.error)
else {
let picUrl = response.data.url
User.findOne({
'fb.id': profile.id
}, (err, user) => {
if (err) {
console.log(err)
return done(err)
} else if (user) {
if (picUrl != user.fb.picUrl) {
user.fb.picUrl = picUrl;
user.update(function(err) {
if (err) throw err
});
}
console.log('exists in the db')
return done(null, user)
} else {
let newUser = new User()
newUser.fb.id = profile.id
newUser.fb.access_token = access_token
newUser.fb.name = profile.name.givenName + ' ' + profile.name.familyName
newUser.fb.email = profile.emails[0].value
newUser.fb.picUrl = picUrl
console.log(picUrl)
newUser.save(function(err) {
if (err) {
throw err
} else {
return done(null, newUser)
}
})
}
})
}
})
}
})
if (!exists) {
return done(null, false)
}
}
})
})
}))
}
|
import { Fragment, useEffect, useState, useRef, useCallback } from 'react'
import './App.scss'
import {
SwitchTransition,
CSSTransition,
TransitionGroup,
} from 'react-transition-group'
import Header from './components/header'
import Content from './components/content'
import Footer from './components/footer'
import Wrapper from './components/Wrapper'
import { Route, Switch } from 'react-router-dom'
function App() {
const [show, setShow] = useState(true)
const [footerMsg, setFooterMsg] = useState({
index: 1,
period: {
startYear: '1839',
endYear: '1860',
},
})
const [friends, setFriends] = useState([])
let add
useEffect(() => {
add = () =>
setTimeout(() => {
console.log('a', friends)
setFriends([...friends, 'coderwhy'])
}, 500)
}, [friends])
const _onFooterChange = (index, period) => {
setFooterMsg({ index, period })
console.log({ index, period })
}
return (
<Fragment>
<Wrapper>
{/* <Header></Header> */}
{/* <div style={{
display:'flex',
flexDirection:'row',
}}>
<CSSTransition
in={show}
timeout={500}
classNames={'slide'}
unmountOnExit={true}
appear={true}
>
<div style={{
height:100,
width:100,
backgroundColor:'red',
}} />
</CSSTransition>
</div>
<button onClick={() => {
setShow(!show)
}}>toggle</button> */}
{/* <TransitionGroup>
{friends.map((item, index) => {
return (
<CSSTransition classNames="friend" timeout={300} key={index}>
<div>{item}</div>
</CSSTransition>
)
})}
<button
onClick={add}
>
addFriend
</button>
<button
onClick={() => {
friends.pop()
setFriends([...friends])
}}
>
--Friend
</button>
</TransitionGroup> */}
<Content
activeIndex={footerMsg.index}
period={footerMsg.period}
></Content>
<Footer onFooterChange={_onFooterChange}></Footer>
</Wrapper>
{/* <Switch>
<Route exact path="/" component={Home} />
<Route exact path="/share" component={Share} />
<Route exact path="/life" component={Life} />
</Switch> */}
</Fragment>
)
}
export default App
|
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom'
import {Input, TextArea, Button} from 'semantic-ui-react';
import {Table, TableBody, TableCell, TableHead, TableRow} from '@material-ui/core';
import './EditPage.css'
class EditEvent extends Component {
state = {
event: {
id: '',
eventName: '',
hostID: this.props.reduxState.user.id,
description: '',
street: '',
apt: '',
city: '',
state: '',
zip: '',
},
addGuestList: {
id: '',
name: '',
email: ''
},
list: []
}
componentDidMount() {
this.fetchDetails();
}
componentDidUpdate(preProps) {
if (this.props.reduxState.singleEvent !== preProps.reduxState.singleEvent) {
this.getDetails()
this.setState({state: this.state})
}
if (this.props.reduxState.list.length !== preProps.reduxState.list.length) {
this.fetchDetails();
this.setState({state: this.state});
}
}
fetchDetails = () => {
this.props.dispatch({ type: "GET_SINGLE_EVENT", payload: this.props.match.params.id })
this.props.dispatch({ type: 'GET_LIST', payload: this.props.match.params.id })
}
getDetails = () => {
console.log("set details");
this.props.reduxState.singleEvent.forEach((event) => {
this.setState({
event: {
id: event.id,
eventName: event.event_name,
hostID: this.props.reduxState.user.id,
description: event.description,
street: event.street,
apt: event.apt,
city: event.city,
state: event.state,
zip: event.zip_code,
},
addGuestList: {
id: event.id
}
})
})
}
handelChange = (e, propertyName) => {
this.setState({
event: {
...this.state.event,
[propertyName]: e.target.value
}
})
}
handelUpdateEvent = (event) => {
event.preventDefault();
this.props.dispatch({ type: 'UPDATE_EVENT', payload: this.state })
this.props.dispatch({ type: 'GET_EVENTS', payload: this.props.reduxState.user.id });
this.props.dispatch({ type: "GET_SINGLE_EVENT", payload: this.props.match.params.id })
this.setState({
event: {
id: '',
eventName: '',
hostID: '',
description: '',
street: '',
apt: '',
city: '',
state: '',
zip: '',
}
})
this.props.history.push(`/event/${this.props.match.params.id}`)
}
addGuestToList = (e, propertyName) => {
this.setState({
addGuestList: {
...this.state.addGuestList,
[propertyName]: e.target.value
}
})
}
addGuest = () => {
this.props.dispatch({ type: 'ADD_GUEST', payload: this.state.addGuestList })
this.fetchDetails()
this.setState({
addGuestList: {
name: '',
email: ''
}
})
}
deletePerson = (id) => {
this.props.dispatch({ type: 'DELETE_PERSON_INVITED', payload: id })
this.fetchDetails()
}
render() {
return (
<div className="addevent">
<div className="eventDetails">
<h1>Edit Event</h1>
<h4>Event Name</h4>
<Input value={this.state.event.eventName} onChange={(e) => this.handelChange(e, "eventName")} />
<h4>Description</h4>
<TextArea className="text_area" value={this.state.event.description} rows="5" onChange={(e) => this.handelChange(e, "description")} />
<h4>Add Guests</h4>
<Input value={this.state.addGuestList.name} onChange={(e) => this.addGuestToList(e, "name")} />
<br />
<Input value={this.state.addGuestList.email} onChange={(e) => this.addGuestToList(e, "email")} />
<br />
<Button onClick={this.addGuest} color="purple">Add Guest</Button>
</div>
<br/>
<div className="guestListEdit">
<h3 className="invitedList">Invited List:</h3>
<Table>
<TableHead>
<TableRow>
<TableCell>Name</TableCell>
<TableCell>Email</TableCell>
<TableCell></TableCell>
</TableRow>
</TableHead>
<TableBody>
{this.props.reduxState.list.map((person) => {
return (
<TableRow key={person.id}>
<TableCell>{person.name}</TableCell>
<TableCell>{person.email}</TableCell>
<TableCell><Button onClick={() => this.deletePerson(person.id)} color="red">Delete</Button></TableCell>
</TableRow>
)
})}
</TableBody>
</Table>
</div>
<div className="address">
<h4>Address</h4>
<Input className="street" label="Street" value={this.state.event.street} onChange={(e) => this.handelChange(e, "street")} />
<br />
<Input className="apt" label="Apt" value={this.state.event.apt} onChange={(e) => this.handelChange(e, "apt")} />
<br />
<Input className="city" label="City" value={this.state.event.city} onChange={(e) => this.handelChange(e, "city")} />
<br />
<Input className="state" label="State" value={this.state.event.state} onChange={(e) => this.handelChange(e, "state")} />
<br />
<Input className="zip" label="Zip Code" value={this.state.event.zip} onChange={(e) => this.handelChange(e, "zip")} />
</div>
<br />
<Button onClick={this.handelUpdateEvent} color="blue">Update Event</Button>
</div>
)
}
}
const mapReduxStateToProps = (reduxState) => ({
reduxState
});
export default withRouter(connect(mapReduxStateToProps)(EditEvent));
|
import { graphql } from "gatsby";
import React, { useState } from "react";
import { Splash } from "../../components/page";
import { Helmet } from "react-helmet";
export const stuffQuery = graphql`
query StuffQuery {
allMarkdownRemark(filter: { frontmatter: { slug: { eq: "/stuff/" } } }) {
nodes {
frontmatter {
title
date
pic
icon
}
html
}
}
}
`;
function Carousel(props) {
return (
<>
<div>
<div className={`is-flex is-justify-content-center stuff-image`}>
<img src={props.pic} alt={props.title + " logo"} width="500px" />
</div>
<article
className={`mt-6`}
dangerouslySetInnerHTML={{ __html: props.content }}
/>
</div>
</>
);
}
const title = (
<Helmet>
<title>Stuff I've Made | Jon Johnson</title>
</Helmet>
);
export default function Stuff({ data }) {
const nodes = data.allMarkdownRemark.nodes;
nodes.sort((a, b) => (a.frontmatter.date > b.frontmatter.date ? 1 : -1));
const [idx, setIdx] = useState(0);
// used to represent each `stuff` entry above the carousel
const Dot = props => {
let classes = `dot is-inline-flex mr-2`;
if (props.icon == null || props.icon === "") {
classes += ` dot-background`;
}
return (
<button
onClick={props.onClick}
className={classes}
key={props.key}
disabled={props.disabled === true ? true : null}
>
<span>
<img
src={props.icon}
width="50px"
alt={props.icon == null ? "" : props.title}
/>
</span>
</button>
);
};
const Dots = () => {
const numDots = nodes.length;
let dotArray = [];
for (let index = 0; index < numDots; index++) {
if (index === idx) {
dotArray[index] = Dot({
disabled: true,
onClick: () => setIdx(index),
key: index,
icon: nodes[index].frontmatter.icon,
});
} else {
dotArray[index] = Dot({
disabled: false,
onClick: () => setIdx(index),
key: index,
icon: nodes[index].frontmatter.icon,
});
}
}
return (
// For whatever reason, applying Bulma styles via classNames wasn't working
<div
style={{
display: "flex",
justifyContent: "center",
marginBottom: "2rem",
}}
>
{dotArray}
</div>
);
};
const stuffTitle = (
<p className={`title is-size-1 has-text-centered`}>Stuff</p>
);
const stuffPrompt = (
<p className={`is-size-4`}>
Here's some side-projects that I've worked on.
</p>
);
// This is the standard layout for 'Stuff', it's used in SSR
// and layouts > 800px wide
const allTheStuff = (
<>
{title}
<Splash logo={stuffTitle} prompt={stuffPrompt} />
<div className={`columns is-centered mt-6`}>
<div className={`column is-flex is-justify-content-flex-end`}>
<button
disabled={idx === 0 ? true : null}
onClick={() => setIdx(idx - 1)}
className={`stuff-button is-size-1 stuff-reg`}
>
< {/* Less than sign */}
</button>
</div>
<div className={`column is-half`}>
<Dots />
<h1 className={`title has-text-centered is-family-sans-serif`}>
{nodes[idx].frontmatter.title}
</h1>
<Carousel
pic={nodes[idx].frontmatter.pic}
content={nodes[idx].html}
title={nodes[idx].frontmatter.title}
/>
</div>
<div className={`column is-flex`}>
<button
disabled={idx === nodes.length - 1 ? true : null}
onClick={() => setIdx(idx + 1)}
className={`stuff-button is-size-1 stuff-reg`}
>
> {/* Greater than sign */}
</button>
</div>
</div>
</>
);
if (typeof window !== "undefined") {
// If the size of the display width is less than 800px
// we use the `mobile` version of the page, which moves the
// left arrow button underneath the Carousel so it's not
// on top of it.
if (window.innerWidth <= 800) {
return (
<>
{title}
<Splash logo={stuffTitle} prompt={stuffPrompt} />
<div className={`columns is-centered is-vcentered mt-6`}>
<div className={`column is-half`}>
<Dots />
<h1 className={`title has-text-centered is-family-sans-serif`}>
{nodes[idx].frontmatter.title}
</h1>
<Carousel
pic={nodes[idx].frontmatter.pic}
content={nodes[idx].html}
/>
</div>
<div className={`column is-flex is-justify-content-center`}>
<button
disabled={idx === 0 ? true : null}
onClick={() => setIdx(idx - 1)}
className={`stuff-button is-size-1`}
>
< {/* Less than sign */}
</button>
<button
disabled={idx === nodes.length - 1 ? true : null}
onClick={() => setIdx(idx + 1)}
className={`stuff-button is-size-1`}
>
> {/* Greater than sign */}
</button>
</div>
</div>
</>
);
}
} else {
return allTheStuff;
}
return allTheStuff;
}
|
// @flow
import { expect } from 'chai';
import sinon from 'sinon';
import stream from 'stream';
import composeWriteChangelog from '../writeChangelog';
describe('plugins / generateNotes / writeChangelog', function(){
beforeEach(function(){
class WriteStream extends stream.Writable {
_write(chunk, enc, next) {
this.chunks = this.chunks || [];
this.chunks.push(chunk);
next();
}
}
let data = 0;
class ReadStream extends stream.Readable {
_read () {
// just emit some random events
data++;
setTimeout(() => {
if (data > 3) {
this.push(null);
this.emit('close');
} else {
this.push(`data ${data}\n`, 'utf8');
}
}, 0);
}
}
const fsWriteStream = this.fsWriteStream = new WriteStream();
const changelogStream = this.changelogStream = new ReadStream();
changelogStream.on('close', () => {
// force a close of the write stream
// not sure why this doesn't happen automatically
fsWriteStream.emit('close');
});
const pkg = this.pkg = {
scope: 'package1',
physicalLocation: '/path/to/package',
repository: {
url: '/url/to/package',
},
};
const releases = this.releases = [];
const changelog = this.changelog = sinon.stub().callsFake((options) => {
expect(options.preset).to.equal('angular');
expect(options.pkg.path).to.equal('/path/to/package/package.json');
expect(options.releaseCount).to.equal(0);
return changelogStream;
});
const transformCommit = this.transformCommit = sinon.stub().returns('transformed');
const fs = this.fs = {
createWriteStream: sinon.stub().callsFake(() => {
return fsWriteStream;
}),
};
this.writeChangelog = composeWriteChangelog(
changelog,
transformCommit,
fs
);
});
it('returns a promise', function(){
const { writeChangelog, pkg, releases } = this;
const result = writeChangelog(pkg, releases);
expect(result).to.be.instanceof(Promise);
});
it('uses conventional-changelog to generate a change log', async function(){
const { changelog, writeChangelog, pkg, releases } = this;
await writeChangelog(pkg, releases);
expect(changelog.called).to.be.true;
});
it('writes to the changelog.md file', async function () {
const { writeChangelog, fsWriteStream, fs } = this;
await writeChangelog(this.pkg, this.releases);
expect(fs.createWriteStream.called).to.be.true;
expect(fs.createWriteStream.calledWith('/path/to/package/CHANGELOG.md', { flags: 'w' })).to.be.true;
expect(fsWriteStream.chunks.length).to.equal(3);
});
it('transforms the commits', async function () {
const {
writeChangelog,
changelog,
transformCommit,
pkg,
releases,
changelogStream,
} = this;
const cb = sinon.spy();
const commit = {};
changelog.callsFake(({ transform }) => {
transform(commit, cb);
return changelogStream;
});
await writeChangelog(pkg, releases);
expect(transformCommit.called).to.be.true;
expect(transformCommit.calledWith('package1', commit, releases)).to.be.true;
expect(cb.called).to.be.true;
expect(cb.calledWith(null, 'transformed')).to.be.true;
});
});
|
import React from "react";
export const BarChartIcon = ({ className, style, width, onClick }) => {
return (
<svg
className={className || ""}
style={style || {}}
xmlns="http://www.w3.org/2000/svg"
height="24"
viewBox="0 0 24 24"
width={width || "24"}
onClick={onClick}
>
<path d="M0 0h24v24H0z" fill="none" />
<path d="M5 9.2h3V19H5zM10.6 5h2.8v14h-2.8zm5.6 8H19v6h-2.8z" />
</svg>
);
};
|
import React, {useEffect, useState} from 'react';
import {Text, View, TouchableOpacity} from 'react-native';
import NearbyItem from './nearbyItem.jsx';
import request from '../request.js';
import style from './../style.js';
const loading = {
name: 'loading...',
_id: 'loading'
};
const Nearby = props => {
const [list, setList] = useState([loading]);
const item = props.place || props.restaurant;
const queryList = props.place ? 'restaurants' : 'places';
useEffect(() => {
let subscribed = true;
const address = item.address;
request.getNearby(props.user, address, queryList, nearbyList => {
if (subscribed) {
setList(nearbyList);
}
});
return () => (subscribed = false);
}, [loading]);
return (
<View style={style.nearbyContainer}>
<Text style={style.labelText}>Address: </Text>
<Text style={style.infoText}>{item.address}</Text>
<Text style={style.labelText}>
Near By {props.place ? 'Restaurants' : 'Places'}:
</Text>
{list.length > 0 ? (
props.place ? (
list.map(restaurant => (
<NearbyItem restaurant={restaurant} key={restaurant._id} />
))
) : (
list.map(place => <NearbyItem place={place} key={place._id} />)
)
) : (
<Text style={style.infoText}>
None, go back to add more {props.place ? 'restaurants' : 'places'}!
</Text>
)}
</View>
);
};
export default Nearby;
|
JournalApp.Routers.Router = Backbone.Router.extend({
initialize: function(options) {
this.collection = new JournalApp.Collections.Posts();
this.$contentEl = options.$contentEl;
this.$sideBarEl = options.$sideBarEl;
this.index();
},
routes: {
"" : "index",
"posts/new" : "new",
"posts/:id" : "show",
"posts/:id/edit" : "edit"
},
index: function() {
this.collection.fetch({ success: function () {
var view = new JournalApp.Views.PostsIndex( { collection: this.collection });
this.$sideBarEl.html(view.render().$el);
}.bind(this)}, { reset: true });
},
show: function(id) {
this.collection.fetch({
success: function() {
var post = this.collection.getOrFetch(id);
var view = new JournalApp.Views.PostShow({ model: post });
this.$contentEl.html(view.render().$el);
}.bind(this)
});
},
edit: function(id) {
this.collection.fetch({ success: function() {
var post = this.collection.getOrFetch(id);
var view = new JournalApp.Views.PostForm({ model: post });
this.$contentEl.html(view.render().$el);
}.bind(this)});
},
new: function() {
this.collection.fetch({ success: function() {
var post = new JournalApp.Models.Post();
var view = new JournalApp.Views.PostForm({ model: post, collection: this.collection });
this.$contentEl.html(view.render().$el);
}.bind(this)});
}
});
|
define(function() {
'use strict';
var chartTesterController = function ($scope, $window) {
$scope.var1 = "hello from directive";
var chart = $window.c3.generate({
data: {
rows: [
['data4', 'data2', 'data3'],
[90, 120, 300],
[40, 160, 240],
[50, 200, 290],
[120, 160, 230],
[80, 130, 300],
[90, 220, 320]
],
type: 'bar'
}
});
chart.flow({
columns: [
['data4', 500],
['data2', 100],
['data3', 200]
],
length: 0
});
};
chartTesterController.$inject = ['$scope', '$window'];
return chartTesterController;
});
|
/* global expect */
const intl = require('../lib')
const IntlMessageFormat = require('intl-messageformat')
const { defaultFormats } = require('../lib/constants')
const { xss } = require('../lib/helper')
function format(key, data) {
const { data: locale, currentLocale } = intl.options
return new IntlMessageFormat(locale[key], currentLocale, defaultFormats).format(data)
}
// 取得到值,但没给 defaultValue
function expectKD(key, data) {
expect(intl.get(key, data)).toBe(format(key, data))
}
// 取得到值,并且给了 defaultValue
function expectKDDV(key, defaultValue, data) {
expect(intl.get(key, defaultValue, data)).toBe(format(key, data))
}
// getHTML 取得到值,但没给 defaultValue
function expectHTMLKD(key, data) {
const r = intl.getHTML(key, data)
expect(r.props.dangerouslySetInnerHTML.__html).toBe(format(key, xss(data)))
}
// getHTML 取得到值,并且给了 defaultValue
function expectHTMLKDDV(key, defaultValue, data) {
const r = intl.getHTML(key, defaultValue, data)
expect(r.props.dangerouslySetInnerHTML.__html).toBe(format(key, xss(data)))
}
// getHTML 取不到值,r 是 getHTML 的结果
function expectHTMLKDNE(r, v) {
expect(r.props.dangerouslySetInnerHTML.__html).toBe(v)
}
// formatHTMLMessage 取得到值,并且给了 defaultValue
function expectFTM(p, data) {
const r = intl.formatHTMLMessage(p, data)
expect(r.props.dangerouslySetInnerHTML.__html).toBe(format(p.id, xss(data)))
}
// formatHTMLMessage 没有取得到值
function expectFTMNE(p, data) {
const r = intl.formatHTMLMessage(p, data)
expect(r.props.dangerouslySetInnerHTML.__html).toBe(p.defaultMessage || p.id)
}
function baseTest() {
const { data } = intl.options
// 取到简单值
expect(intl.get('home')).toBe(data.home)
expect(intl.get('SIMPLE')).toBe(data.SIMPLE)
// 没取到值
expect(intl.get('NOT_EXIST')).toBe('NOT_EXIST')
expect(intl.get('NOT_EXIST', 'defaultValue')).toBe('defaultValue')
expect(intl.get('NOT_EXIST', { age: 22 })).toBe('NOT_EXIST')
expect(intl.get('NOT_EXIST', 'defaultValue', { age: 22 })).toBe('defaultValue')
// getHTML 且没取到值
expectHTMLKDNE(intl.getHTML('NOT_EXIST'), 'NOT_EXIST')
expectHTMLKDNE(intl.getHTML('NOT_EXIST', 'defaultValue'), 'defaultValue')
expectHTMLKDNE(intl.getHTML('NOT_EXIST', { message: 'html' }), 'NOT_EXIST')
expectHTMLKDNE(intl.getHTML('NOT_EXIST', 'defaultValue', { message: 'html' }), 'defaultValue')
// formatMessage
expect(intl.formatMessage({ id: 'home' })).toBe(data.home)
expect(intl.formatMessage({ id: 'HELLO' }, { name: 'poly', where: 'China' })).toBe(format('HELLO', { name: 'poly', where: 'China' }))
expect(intl.formatMessage({ id: 'NOT_EXIST' })).toBe('NOT_EXIST')
expect(intl.formatMessage({ id: 'NOT_EXIST', defaultMessage: 'defaultValue' })).toBe('defaultValue')
// formatHTMLMessage
expectFTM({ id: 'TIP' })
expectFTM({ id: 'TIP', defaultValue: 'defaultValue' })
expectFTM({ id: 'TIP_VAR' }, { message: 'HTML with variables' })
expectFTM({ id: 'TIP_VAR', defaultValue: 'defaultValue' }, { message: 'HTML with variables' })
expectFTMNE({ id: 'NOT_EXIST' })
expectFTMNE({ id: 'NOT_EXIST', defaultValue: 'defaultValue' })
expectFTMNE({ id: 'NOT_EXIST' }, { age: 22 })
expectFTMNE({ id: 'NOT_EXIST', defaultValue: 'biubiu' }, { age: 30 })
// 取到值
expectKD('HELLO', { name: 'tom', where: 'China' })
expectKD('SALE_PRICE', { price: 123456.78 })
expectKD('SALE_START', { start: new Date() })
expectKD('SALE_END', { end: new Date() })
expectKD('COUPON', { expires: new Date() })
expectKD('PHOTO', { photoNum: 0 })
expectKD('PHOTO', { photoNum: 1 })
expectKD('PHOTO', { photoNum: 1000000 })
expectHTMLKD('TIP')
expectHTMLKD('TIP_VAR', { message: 'HTML with variables' })
expectHTMLKD('TIP_VAR', { message: '<script>alert("ReactIntlUniversal prevents from xss attack")</script>' })
// 取到值,并且提供默认值(默认值不会起作用)
expectKDDV('HELLO', 'defaultValue', { name: 'tom', where: 'China' })
expectKDDV('SALE_PRICE', 'defaultValue', { price: 123456.78 })
expectKDDV('SALE_START', 'defaultValue', { start: new Date() })
expectKDDV('SALE_END', 'defaultValue', { end: new Date() })
expectKDDV('COUPON', 'defaultValue', { expires: new Date() })
expectKDDV('PHOTO', 'defaultValue', { photoNum: 0 })
expectKDDV('PHOTO', 'defaultValue', { photoNum: 1 })
expectKDDV('PHOTO', 'defaultValue', { photoNum: 1000000 })
expectHTMLKDDV('TIP', 'defaultValue')
expectHTMLKDDV('TIP_VAR', 'defaultValue', { message: 'HTML with variables' })
expectHTMLKDDV('TIP_VAR', 'defaultValue', { message: '<script>alert("ReactIntlUniversal prevents from xss attack")</script>' })
}
exports.baseTest = baseTest
|
//functional approach...
// import React, { useState, useEffect } from 'react'
// import Modal from '../Components/UI/Modal/Modal'
// import Aux from './Auxilliary'
// const WithErrorHandler = (WrappedComponent, axios) => {
// const ErrorWrapper = props => {
// const [errorMsg, setErrorMsg] = useState(null);
// //will mount
// const reqInterceptor = axios.interceptors.request.use(request => {
// console.log(request)
// setErrorMsg(null)
// return request
// })
// const resInterceptor = axios.interceptors.response.use(
// response => response,
// error => {
// console.log('Response Interceptor, Error:', error)
// setErrorMsg(error)
// return Promise.reject(error);
// }
// )
// useEffect(() => {
// //unmount
// return () => {
// console.log('Unmounting Interceptors !')
// axios.interceptors.request.eject(reqInterceptor)
// axios.interceptors.response.eject(resInterceptor)
// }
// }, [reqInterceptor, resInterceptor])
// const modalCloseHandler = () => {
// setErrorMsg(null)
// }
// //console.log('Inside render')
// return (
// <Aux>
// {console.log('before modal call', errorMsg)}
// <Modal show={errorMsg} backdropClicked={modalCloseHandler} >
// {console.log('Inside Modal', errorMsg)}
// {errorMsg ? errorMsg.message : null}
// </Modal>
// <WrappedComponent {...props} />
// </Aux>
// )
// }
// return ErrorWrapper
// }
// export default WithErrorHandler
//class based approach
// import React, { Component } from 'react'
// import Modal from '../Components/UI/Modal/Modal'
// import Aux from './Auxilliary'
// const withErrorHandler = (WrappedComponent, axios) => {
// return class extends Component {
// state = {
// errorMsg: null
// }
// // constructor(props) {
// // super(props);
// // console.log('Inside constructor')
// // axios.interceptors.request.use(request => {
// // this.state = { errorMsg: null }
// // return request
// // })
// // axios.interceptors.response.use( response => response , error => {
// // this.state = { errorMsg: error }
// // console.log('Interceptor' + this.state.errorMsg)
// // })
// // }
// componentWillMount() {
// //console.log('Inside WillMount Hook')
// this.reqInterceptor = axios.interceptors.request.use(request => {
// this.setState({ errorMsg: null })
// return request
// })
// this.resInterceptor = axios.interceptors.response.use( response => response , error => {
// this.setState({ errorMsg: error })
// console.log('Interceptor', this.state.errorMsg)
// })
// }
// componentDidMount() {
// this._isMounted = true;
// console.log('Error handling mounted!!!', this._isMounted)
// }
// componentWillUnmount() {
// console.log('WillUnmount' + this.reqInterceptor + this.resInterceptor)
// this._isMounted = false;
// axios.interceptors.request.eject(this.reqInterceptor)
// axios.interceptors.response.eject(this.resInterceptor)
// }
// modalCloseHandler = () => {
// this.setState({ errorMsg: null })
// }
// render() {
// //console.log('Inside render')
// return (
// <Aux>
// {/* {console.log('before modal call'+this.state.errorMsg)} */}
// <Modal show={this.state.errorMsg} backdropClicked={this.modalCloseHandler} >
// {/* {console.log('Inside Modal' + this.state.errorMsg)} */}
// {this.state.errorMsg ? this.state.errorMsg.message : null}
// </Modal>
// <WrappedComponent {...this.props} />
// </Aux>
// )
// }
// }
// }
// export default withErrorHandler
//functional approach with custom httperrorhandler hook...
import React from 'react'
import Modal from '../Components/UI/Modal/Modal'
import Aux from './Auxilliary'
import useHttpErrorHandler from '../hooks/httpErrorHandler'
const WithErrorHandler = (WrappedComponent, axios) => {
const InnerWrapper = props => {
const { errorMsg, setErrorMsg } = useHttpErrorHandler(axios)
const modalCloseHandler = () => {
setErrorMsg(null)
}
return (
<Aux>
{console.log('before modal call', errorMsg)}
<Modal show={errorMsg} backdropClicked={modalCloseHandler} >
{console.log('Inside Modal', errorMsg)}
{errorMsg ? errorMsg.message : null}
</Modal>
<WrappedComponent {...props} />
</Aux>
)
}
return InnerWrapper
}
export default WithErrorHandler // new react update expects a capital letter start for both class based and funtional components
|
import React from "react";
import * as classes from './NumericInput.module.css';
const NumericInput = ({ onIncrement, onDecrement, className, ...props }) => {
return (
<div className={className}>
<input
className={classes.form__input}
type="numeric"
{...props}
/>
<button
className={classes.form__btn}
onClick={onIncrement}
>+
</button>
<button
className={classes.form__btn}
onClick={onDecrement}
>-
</button>
</div>
)
}
export default NumericInput;
|
import * as TYPES from "./types";
import * as API from "../assets/js/Common/API"
import axios from 'axios'
import BigNumber from 'bignumber.js'
import BoboPair from "../assets/contracts/abi/BoboPair.json";
import * as BASEJS from '../assets/js/Common/base'
const mutations = {
[TYPES.CHANGE_SKIN](state, v) {
state.skin = v;
localStorage.setItem("Skin", v);
},
[TYPES.CHANGE_HEADER](state, v) {
state.header = v;
},
[TYPES.SET_ACCOUNT](state, v) {
state.account = v;
},
[TYPES.SET_ISCONNECTED](state, v) {
state.isConnected = v;
},
[TYPES.SET_CHAINID](state, v) {
state.chainId = v;
},
[TYPES.SET_WEB3](state, v) {
state.web3 = v;
},
[TYPES.SET_DRIZZLE](state, v) {
state.drizzle = v;
},
[TYPES.GET_HANGQING](state, v) {
state.hangqing = [];
let chainId = state.chainId.toString()
axios.get(API.getQuotation).then((quotation) => {
//console.log(quotation)
const list = quotation.data[chainId];
let assets = {};
list.assets.map(asset => {
assets[asset.address] = asset;
})
for (var i = 0; i < list.pairs.length; i++) {
const pairBaseInfo = list.pairs[i];
for (var j = 0; j < pairBaseInfo.peerTokens.length; j++) {
const peerAddr = pairBaseInfo.peerTokens[j];
//var pairInfo = assets[peerAddr];
if (assets[peerAddr] == null) {
console.log(peerAddr + ' has no token info.')
return;
}
const pairInfo = JSON.parse(JSON.stringify(assets[peerAddr]));
pairInfo.baseTokenAddr = pairBaseInfo.baseTokenAddr;
pairInfo.baseTokenName = pairBaseInfo.baseTokenName;
pairInfo.coingecko_currency = pairBaseInfo.coingecko_currency;
//24H涨跌幅
let url = API.getRiseFall + "vs_currency=" + pairInfo.coingecko_currency + "&ids=" + pairInfo.coingeckoId;
axios.get(url).then((res) => {
if (pairInfo == null) {
console.log(url, res);
return;
}
pairInfo.high24h = res.data[0].price_change_percentage_24h.toFixed(2);
state.hangqing.push(pairInfo);
});
// 24成交量
setTimeout(() => {
const boboFactory = state.drizzle.contracts.BoboFactory;
boboFactory.methods
.getPair(peerAddr, pairBaseInfo.baseTokenAddr)
.call()
.then((pairAddr) => {
if (pairAddr != '0x0000000000000000000000000000000000000000') {
//console.log(pairAddr, '=>', peerAddr, pairBaseInfo.baseTokenAddr);
pairInfo.pairAddr = pairAddr;
const boboPair = new state.web3.eth.Contract(BoboPair, pairAddr);
boboPair.methods.volumnOf24Hours().call().then(volumn => {
pairInfo.volumnOf24Hours = volumn;
});
boboPair.methods.getCurrentPrice().call().then(price => {
console.log(pairAddr, price);
pairInfo.currentPrice = new BigNumber(price).shiftedBy(-6);
});
} else {
pairInfo.volumnOf24Hours = 0;
}
});
}, state.drizzle == null ? 1500 : 1000);
// 聚合价
}
}
});
},
[TYPES.GET_TRADEINFO](state, v) {
let coingeckoMap = {};
let id2PairMap = {};
state.hangqing.map(pairInfo => {
if (id2PairMap[pairInfo.coingecko_currency + '-' + pairInfo.coingeckoId] == null) {
id2PairMap[pairInfo.coingecko_currency + '-' + pairInfo.coingeckoId] = [];
id2PairMap[pairInfo.coingecko_currency + '-' + pairInfo.coingeckoId].push(pairInfo);
} else {
id2PairMap[pairInfo.coingecko_currency + '-' + pairInfo.coingeckoId].push(pairInfo);
}
if (coingeckoMap[pairInfo.coingecko_currency] == null) {
coingeckoMap[pairInfo.coingecko_currency] = [];
coingeckoMap[pairInfo.coingecko_currency].push(pairInfo.coingeckoId);
} else {
coingeckoMap[pairInfo.coingecko_currency].push(pairInfo.coingeckoId);
}
});
Object.keys(coingeckoMap).forEach((currency) => {
let coingeckoIds = coingeckoMap[currency].join();
let url = API.getRiseFall + "vs_currency=" + currency + "&ids=" + coingeckoIds;
axios.get(url).then((marketInfo) => {
marketInfo.data.map(item => {
id2PairMap[currency + '-' + item.id].map(onePairInfo => {
onePairInfo.high24h = item.price_change_percentage_24h.toFixed(2);
})
})
});
});
}
}
export default mutations
|
module.exports = (sequelize, DataTypes) => {
var Professeur = sequelize.define('professeur', {
email: {
type: DataTypes.STRING,
unique: true,
allowNull: false,
primaryKey: true
},
nom: {
type: DataTypes.STRING,
allowNull: false
},
prenom: {
type: DataTypes.STRING,
allowNull: false
},
id_carte: {
type: DataTypes.STRING
}
});
Professeur.associate = function (models) {
models.professeurs.belongsTo(models.users, {
//onDelete: "CASCADE",
foreignKey: 'email',
constraints: false
});
models.professeurs.hasMany(models.presences, {
//onDelete: "CASCADE",
foreignKey: 'id_carte',
sourceKey:'id_carte',
constraints: false
});
models.professeurs.hasOne(models.cartes, {
foreignKey: 'email',
sourceKey: 'email',
constraints: false
})
models.professeurs.hasMany(models.courss, {
//onDelete: "CASCADE",
foreignKey: 'email',
sourceKey: 'email',
constraints: false
});
};
return Professeur;
};
|
var express = require('express');
const bodyParser = require('body-parser');
var User = require('../models/user');
var Forgot = require('../models/forgot');
var passport = require('passport');
var send_mail = require('./mail');
var authenticate = require('../authenticate');
const nodemailer = require("nodemailer");
var rand = require("random-key");
var router = express.Router();
router.use(bodyParser.json());
router.post('/',(req, res, next) => {
User.find({username: req.body.username})
.then((user) => {
if(user.length){
var key = rand.generate(7);
Forgot.create({
username: req.body.username,
key: key
})
.then((data) => {
res.setHeader('Content-Type','application/json');
res.statusCode = 200;
send_mail.send_mail(req.body.username,"Change Password","https://loving-beaver-54e03f.netlify.app/reset_password/"+key);
res.json({message : 'Link has been sent to your Mail ID. Please go to it to change the password'});
},(err) => {
res.setHeader('Content-Type','application/json');
error = {message: 'Server Error. Please try after sometime!'};
res.status(401).send(error);
})
.catch((err) => {
res.setHeader('Content-Type','application/json');
error = {message: 'Server Error. Please try after sometime!'};
res.status(401).send(error);
});
}
else{
res.setHeader('Content-Type','application/json');
error = {message: 'invalid user'};
res.status(401).send(error);
}
},error => {
res.setHeader('Content-Type','application/json');
res.status(401).send(error);
})
.catch(error => {
res.setHeader('Content-Type','application/json');
res.status(401).send(error);
});
});
module.exports = router;
|
var searchData=
[
['bfsize_78',['bfSize',['../structbmfh.html#a99c44db833a458a7be8ddf4fe19f6ffa',1,'bmfh']]],
['bftype_79',['bfType',['../structbmfh.html#adaefa585a14767d74cdedb0e3ff6daa3',1,'bmfh']]],
['bisize_80',['biSize',['../structbmih.html#a4d826e11c94868cb46a04c376998c85e',1,'bmih']]],
['bitcount_81',['BitCount',['../structbmih.html#a9f2b08dbee672c9da1bd1f104124dbca',1,'bmih']]],
['bmfheader_82',['bmFHeader',['../structbmp_file.html#a9d4365b4c361b3ef5d994220fb484dd4',1,'bmpFile']]],
['bmiheader_83',['bmIHeader',['../structbmp_file.html#acaee65f96c0c723cbc6ca099dca1a9e1',1,'bmpFile']]]
];
|
const bookmarks = [];
const adding = false;
const error = null;
const filter = 1;
const isExpanded = {
expand : false
};
const findById = function(id) {
return this.bookmarks.find(currentItem => currentItem.id === id);
};
const addBookmark = function(bkmk) {
$.extend(bkmk, isExpanded);
this.bookmarks.push(bkmk);
};
const deleteBookmark = function(id) {
for(let i = 0; i < this.bookmarks.length; i++) {
if(this.bookmarks[i].id === id){
this.bookmarks.splice(i, 1);
}
}
};
const setError = function(error) {
this.error = error;
};
export default {
bookmarks,
adding,
error,
filter,
findById,
addBookmark,
deleteBookmark,
setError
};
|
import React, { useState } from 'react';
import Grid from './Grid.js';
import Controls from './Controls.js';
// Macros
const sizeX = 50;
const sizeY = 50;
const start = [12, 18];
const end = [35, 26];
const speed = 5;
// Init Grid
const initRows = new Array(sizeY);
for (let i = 0; i < initRows.length; i++) {
initRows[i] = new Array(sizeX);
}
for (let y = 0; y < sizeY; y++) {
for (let x = 0; x < sizeX; x++) {
initRows[y][x] = {
posX: x,
posY: y,
discovered: false,
currentPath: false,
finalPath: false,
traversable: true,
parent: [],
gCost: Infinity,
hCost: 0,
fCost: Infinity
};
}
}
function App() {
// State
const [rows, setRows] = useState(initRows);
const [mode, setMode] = useState('wall');
const [startNode, setStartNode] = useState(start);
const [endNode, setEndNode] = useState(end);
const [nodeInfo, setNodeInfo] = useState([]);
// [mouseIsDragging, createWalls(aka pathIsTraversable)]
const [dragging, setDragging] = useState([false, true]);
function clearedGrid(removeWalls) {
const grid = rows;
for (let i = 0; i < grid.length; i++) {
for (let j = 0; j < grid[i].length; j++) {
grid[i][j].discovered = false;
grid[i][j].open = false;
grid[i][j].hCost = 0;
grid[i][j].gCost = Infinity;
grid[i][j].fCost = Infinity;
grid[i][j].currentPath = false;
grid[i][j].finalPath = false;
grid[i][j].parent = [];
if (removeWalls) {
grid[i][j].traversable = true;
}
}
}
return grid;
}
function resetGrid() {
const freshGrid = clearedGrid(true);
updateState(freshGrid);
}
function resetPath() {
const freshGrid = clearedGrid(false);
updateState(freshGrid);
}
// UPDATE STATE
// Initialize entirely new empty grid in order to update state
function updateState(updatedArray) {
const newRows = new Array(rows.length);
for (let h = 0; h < newRows.length; h++) {
newRows[h] = new Array(rows[h].length);
}
// Populate grid with brand new objects
for (let i = 0; i < newRows.length; i++) {
for (let j = 0; j < newRows[i].length; j++) {
// Copy values into new array
newRows[i][j] = updatedArray[i][j];
}
}
setRows(newRows);
}
function controlClicked(type) {
if (type === 'wall') {
setMode('wall');
}
else if (type === 'start') {
setMode('start');
}
else if (type === 'end') {
setMode('end');
}
}
function mouse(eventType, x, y) {
const newGrid = rows;
if (eventType === 'enter') {
setNodeInfo(newGrid[y][x]);
}
if (mode === 'wall') {
if (posAreSame(startNode, [x, y]) || posAreSame(endNode, [x, y])) {
// do nothing
}
else {
if (eventType === 'down') {
// start dragging
// if it's traversable (not a wall), createWalls = true
// if it's untraversable (a wall), createWalls = false
setDragging([true, newGrid[y][x].traversable]);
newGrid[y][x].traversable = !newGrid[y][x].traversable;
updateState(newGrid);
}
else if (eventType === 'enter') {
if (dragging[0]) {
// if creating walls
if (dragging[1]) {
newGrid[y][x].traversable = false;
}
// if not creating walls (destroying walls)
else {
newGrid[y][x].traversable = true;
}
updateState(newGrid);
}
}
else if (eventType === 'up') {
// stop dragging, keep createWalls value (which is set on down)
setDragging([false, dragging[1]]);
}
}
}
else if (mode === 'start' && eventType === 'click') {
setStartNode([x, y]);
resetPath();
updateState(newGrid);
}
else if (mode === 'end' && eventType === 'click') {
setEndNode([x, y]);
resetPath();
updateState(newGrid);
}
}
function posAreSame(pos1, pos2) {
// console.log(`comparing pos1 ${pos1[0]},${pos1[1]} to pos2 ${pos2[0]},${pos2[1]}.`);
if (pos1[0] !== pos2[0]) { // X
return false;
}
if (pos1[1] !== pos2[1]) { // Y
return false;
}
return true;
}
function A_star() {
const grid = clearedGrid(false);
var counter = 0;
const originNode = grid[startNode[1]][startNode[0]];
const targetNode = grid[endNode[1]][endNode[0]];
originNode.hCost = distance(originNode, targetNode);
originNode.gCost = 0;
originNode.fCost = 0;
originNode.discovered = true;
originNode.parent = null;
var OPEN = []; // discovered nodes
var CLOSED = [];
OPEN.push(originNode);
const loop = () => {
setTimeout(() => {
// ALGORITHM LOOP
if (!OPEN) {
console.log("Failed.");
return;
}
// console.log("Open: ");
// console.log(OPEN);
// Lowest fCost node in OPEN
var cIndex = getIndexOfLowestFCost(OPEN);
var currentNode = OPEN[cIndex];
if (!currentNode) {
return;
}
currentNode.currentPath = true;
// remove current node from OPEN and add to CLOSED
OPEN.splice(cIndex, 1);
CLOSED.push(currentNode);
// we reached our goal!
if (currentNode === targetNode) {
// start back tracking the final path
const backTrackingPath = [];
var backTrackingNode = currentNode.parent;
while (backTrackingNode) {
if (!posAreSame(backTrackingNode, startNode)) {
backTrackingPath.push([backTrackingNode[1], backTrackingNode[0]]);
grid[backTrackingNode[1]][backTrackingNode[0]].finalPath = true;
backTrackingNode = grid[backTrackingNode[1]][backTrackingNode[0]].parent;
}
else {
backTrackingNode = null;
}
}
// console.log(backTrackingPath);
updateState(grid);
return;
}
// NEIGHBORS
let neighborNodes = getNeighbors(currentNode, rows);
neighborNodes.forEach(neighborNode => {
let isInClosed = CLOSED.find(nodeInClosed => nodeInClosed === neighborNode);
// if neighbor node is a wall or has already been visited (AKA it has been "currentNode"), skip it
if (neighborNode.traversable && !isInClosed) {
neighborNode.discovered = true;
neighborNode.hCost = distance(neighborNode, targetNode);
neighborNode.fCost = neighborNode.hCost + neighborNode.gCost;
// check the path to the neighbor node
let tentative_gCost = currentNode.gCost + distance(neighborNode, currentNode);
// if the recalculated gCost is better than the old one
// true for first time discovered nodes because default gCost is Infinity
if (tentative_gCost < neighborNode.gCost) {
neighborNode.gCost = tentative_gCost;
neighborNode.fCost = neighborNode.hCost + neighborNode.gCost;
neighborNode.parent = [currentNode.posX, currentNode.posY];
let isInOpen = OPEN.find(nodeInOpen => nodeInOpen === neighborNode);
if (!isInOpen) {
OPEN.push(neighborNode);
}
}
}
});
updateState(grid);
counter++;
loop();
}, speed);
}
loop();
}
function distance(node1, node2) {
const d = Math.sqrt(Math.pow((node1.posX - node2.posX), 2) + Math.pow((node1.posY - node2.posY), 2));
return Math.round(d * 10);
}
function getIndexOfLowestFCost(openArray) {
const fCosts = [];
openArray.forEach(node => {
fCosts.push(node.fCost);
});
const lowestFCost = Math.min(...fCosts);
return fCosts.indexOf(lowestFCost);
}
function getNeighbors(node, grid) {
if (!node) {
return [];
}
const neighbors = [];
// Left
if (node.posX > 0) {
neighbors.push(grid[node.posY][node.posX - 1]);
}
// Right
if (node.posX < (grid[0].length - 1)) {
neighbors.push(grid[node.posY][node.posX + 1]);
}
// Up
if (node.posY > 0) {
neighbors.push(grid[node.posY - 1][node.posX]);
}
// Down
if (node.posY < (grid.length - 1)) {
neighbors.push(grid[node.posY + 1][node.posX]);
}
// Left/Up
if (node.posX > 0 && node.posY > 0) {
neighbors.push(grid[node.posY - 1][node.posX - 1]);
}
// Right/Up
if (node.posX < (grid[0].length - 1) && node.posY > 0) {
neighbors.push(grid[node.posY - 1][node.posX + 1]);
}
// Left/Down
if (node.posX > 0 && node.posY < (grid.length - 1)) {
neighbors.push(grid[node.posY + 1][node.posX - 1]);
}
// Right/Down
if (node.posX < (grid[0].length - 1) && node.posY < (grid.length - 1)) {
neighbors.push(grid[node.posY + 1][node.posX + 1]);
}
return neighbors;
}
return (
<div className="App">
<h1>A* Pathfinding Algorithm Visualizer</h1>
<Controls clicked={controlClicked} mode={mode} />
<div className="mainButtons">
<button onClick={A_star}>Visualize</button>
<button onClick={resetGrid}>Reset</button>
</div>
<div className="nodeInfo">
<p>X: {nodeInfo.posX}, Y: {nodeInfo.posY}</p>
<p>G Cost: {nodeInfo.gCost}</p>
<p>H Cost: {nodeInfo.hCost}</p>
<p>F Cost: {nodeInfo.fCost}</p>
</div>
<Grid rows={rows} start={startNode} end={endNode} mouse={mouse} />
</div>
);
}
export default App;
|
const webpack = require('webpack');
const file_config = {
'test': /\.png$/,
'use': [
{
'loader': 'file-loader',
'options': {
'name': '[name].[ext]',
'outputPath': './images/'
}
}
]
}
module.exports = file_config;
|
const Reservation = require('./mongoInit.js');
module.exports = {
getAll: () => Reservation.find({}),
getOne: restaurantID => Reservation.find({ restaurantID }).limit(1),
updateOne: (restaurantID, obj) =>
Reservation.findOneAndUpdate({ restaurantID }, obj),
deleteOne: restaurantID => Reservation.remove({ restaurantID }),
createOne: (
obj //expects obj without restaurantID
) =>
Reservation.find({})
.sort({ restaurantID: -1 })
.limit(1)
.then(data => {
obj.restaurantID = data[0].restaurantID + 1;
return Reservation.create(obj);
})
};
|
function Renderer_ViaFilter() {
};
Renderer_ViaFilter.prototype.render = function(container) {
container.empty();
var fieldset = $('<fieldset></fieldset>');
fieldset.append($('<label></label>').attr('for', 'filter-via-street').text(
'Strada di riferimento'));
fieldset.append($('<input></input>').attr('type', 'text').attr('name',
'filter-via-street').val(((filterCache['via']['streetReference']) ? filterCache['via']['streetReference'] : '')));
fieldset.append($('<label></label>').attr('for', 'filter-via-area').text(
'Area'));
var selectArea = $('<select></select>').attr('name', 'filter-via-area');
selectArea.append($('<option></option>').attr('value', '').text(''));
$.each(aree, function(key, value) {
var option = $('<option></option').attr('value', this['id']).text(
this['name']);
if(filterCache['via']['area'] && filterCache['via']['area'] == this['id']){
option.attr('selected','selected');
}
selectArea.append(option);
});
fieldset.append(selectArea);
container.append(fieldset);
};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.