conflict_resolution
stringlengths
27
16k
<<<<<<< import React from "react" import Switch from "react-router-dom/Switch" import Route from "react-router-dom/Route" import Helmet from "react-helmet" import Menu from "components/Menu/Menu" import Loading from "components/Loading/Loading" import RedirectWithStatus from "components/RouterStatus/RedirectWithStatus" import Home from "../Home" import Examples from "../Examples" import NotFound from "../NotFound" import Hero from "../Hero/Hero" import config from "../../config" import style from "./App.scss" ======= // @flow import React from 'react' import Switch from 'react-router-dom/Switch' import Route from 'react-router-dom/Route' import Helmet from 'react-helmet' import Menu from 'components/Menu/Menu' import Loading from 'components/Loading/Loading' import RedirectWithStatus from 'components/RouterStatus/RedirectWithStatus' import Home from '../Home' import Examples from '../Examples' import NotFound from '../NotFound' import Hero from '../Hero/Hero' import config from '../../config' import style from './App.scss' >>>>>>> // @flow import React from "react" import Switch from "react-router-dom/Switch" import Route from "react-router-dom/Route" import Helmet from "react-helmet" import Menu from "components/Menu/Menu" import Loading from "components/Loading/Loading" import RedirectWithStatus from "components/RouterStatus/RedirectWithStatus" import Home from "../Home" import Examples from "../Examples" import NotFound from "../NotFound" import Hero from "../Hero/Hero" import config from "../../config" import style from "./App.scss"
<<<<<<< import React from "react" import Helmet from "react-helmet" import Link from "react-router-dom/Link" ======= // @flow import React from 'react' import Helmet from 'react-helmet' import Link from 'react-router-dom/Link' >>>>>>> // @flow import React from "react" import Helmet from "react-helmet" import Link from "react-router-dom/Link"
<<<<<<< let bountyToken, bountyDecimals this.props.tokens.forEach( token => { if(token.symbol === bountySymbol) { bountyToken = token.addr bountyDecimals = token.decimals } ======= let bountyToken this.props.tokens.forEach(token => { if (token.symbol === bountySymbol) { bountyToken = token.addr >>>>>>> let bountyToken, bountyDecimals this.props.tokens.forEach( token => { if(token.symbol === bountySymbol) { bountyToken = token.addr bountyDecimals = token.decimals } <<<<<<< console.log('Bounty data for app.addBounties', issuesArray.map( (issue) => issue.repoId), issuesArray.map( (issue) => issue.number), issuesArray.map( (issue) => BigNumber(issue.size).times(10 ** bountyDecimals).toString()), issuesArray.map( (issue) => issue.deadline), ======= console.log( 'Bounty data for app.addBounties', issuesArray.map(issue => issue.repoId), issuesArray.map(issue => issue.number), issuesArray.map(issue => issue.size), issuesArray.map(issue => issue.deadline), >>>>>>> console.log('Bounty data for app.addBounties', issuesArray.map( (issue) => issue.repoId), issuesArray.map( (issue) => issue.number), issuesArray.map( (issue) => BigNumber(issue.size).times(10 ** bountyDecimals).toString()), issuesArray.map( (issue) => issue.deadline), <<<<<<< issuesArray.map( (issue) => web3.toHex(issue.repoId)), issuesArray.map( (issue) => issue.number), issuesArray.map( (issue) => BigNumber(issue.size).times(10 ** bountyDecimals).toString()), issuesArray.map( (issue) => {return ( Date.now() + 8600 )} ), ======= issuesArray.map(issue => web3.toHex(issue.repoId)), issuesArray.map(issue => issue.number), issuesArray.map(issue => issue.size), issuesArray.map(issue => { return Date.now() + 8600 }), >>>>>>> issuesArray.map( (issue) => web3.toHex(issue.repoId)), issuesArray.map( (issue) => issue.number), issuesArray.map( (issue) => BigNumber(issue.size).times(10 ** bountyDecimals).toString()), issuesArray.map(issue => { return Date.now() + 8600 }),
<<<<<<< ======= Button, >>>>>>> <<<<<<< import { Form, FormField, FieldTitle } from '../../Form' import { DateInput } from '../../../../../../shared/ui' ======= import { DateInput, Form, FormField, FieldTitle, DescriptionInput } from '../../Form' >>>>>>> import { Form, FormField, FieldTitle } from '../../Form' import { DateInput } from '../../../../../../shared/ui' <<<<<<< hours: issue.hours, exp: issue.exp, deadline: new Date(issue.deadline), ======= hours: 0, exp: 0, deadline: addHours( new Date(), this.props.bountySettings.bountyDeadline ), >>>>>>> hours: issue.hours, exp: issue.exp, deadline: new Date(issue.deadline), <<<<<<< size: 0 ======= detailsOpen: 0, size: 0, >>>>>>> size: 0 <<<<<<< this.props.onSubmit(this.state.bounties) ======= console.info('Submitting new Bounties', this.state.bounties) this.props.onSubmit(this.state.bounties, this.state.description) >>>>>>> console.info('Submitting new Bounties', this.state.bounties) this.props.onSubmit(this.state.bounties, this.state.description) <<<<<<< ======= <FormField label="Description" required input={ <DescriptionInput rows={3} style={{ resize: 'none' }} onChange={this.descriptionChange} wide /> } /> >>>>>>> <FormField label="Description" required input={ <DescriptionInput rows={3} style={{ resize: 'none' }} onChange={this.descriptionChange} wide /> } />
<<<<<<< // TODO: @aragon/ui Table? // workStatus can be either: 'new', 'review-applicants', 'review-work', or 'finished' // It represents the state of the current issue in the approval bounty flow const Issue = ({workStatus, title, repo, number, labels, isSelected, onSelect, onSubmitWork, onRequestAssignment, onReviewApplication, balance, symbol }) => ( ======= const Issue = ({ title, repo, number, labels, isSelected, onClick, onSelect, onSubmitWork, onRequestAssignment, onReviewApplication, balance, symbol}) => ( >>>>>>> // TODO: @aragon/ui Table? // workStatus can be either: 'new', 'review-applicants', 'review-work', or 'finished' // It represents the state of the current issue in the approval bounty flow const Issue = ({workStatus, title, repo, number, labels, isSelected, onClick, onSelect, onSubmitWork, onRequestAssignment, onReviewApplication, balance, symbol }) => (
<<<<<<< import { AppBar, Main, SidePanel } from '@aragon/ui' ======= import styled from 'styled-components' import { map } from 'rxjs/operators' import { AppBar, AppView, Main, SidePanel, observe, font } from '@aragon/ui' >>>>>>> import { AppBar, AppView, Main, SidePanel } from '@aragon/ui' <<<<<<< import AppView from './components/AppView' import { useAragonApi } from '@aragon/api-react' import { IdentityProvider } from '../../../shared/identity' ======= >>>>>>> import { useAragonApi } from '@aragon/api-react' import { IdentityProvider } from '../../../shared/identity' <<<<<<< <IdentityProvider onResolve={this.handleResolveLocalIdentity} onShowLocalIdentityModal={this.handleShowLocalIdentityModal}> <AppView padding={0} appBar={ <AppBar> <AppTitle title="Dot Voting" displayMenuButton={displayMenuButton} /> </AppBar> ======= <AppView appBar={ <AppBar> <AppTitle title="Dot Voting" displayMenuButton={displayMenuButton} css="padding-left: 30px" /> </AppBar> } > <Decisions onActivate={this.handlePanelOpen} app={this.props.app} votes={this.props.votes !== undefined ? this.props.votes : []} entries={this.props.entries !== undefined ? this.props.entries : []} voteTime={this.props.voteTime} minParticipationPct={ this.props.minParticipationPct ? this.props.minParticipationPct / 10 ** 16 : 'N/A' >>>>>>> <IdentityProvider onResolve={this.handleResolveLocalIdentity} onShowLocalIdentityModal={this.handleShowLocalIdentityModal}> <AppView padding={0} appBar={ <AppBar> <AppTitle title="Dot Voting" displayMenuButton={displayMenuButton} css="padding-left: 30px" /> </AppBar>
<<<<<<< import { AppBar, AppView, Main, observe, TabBar, font } from '@aragon/ui' ======= import { AppView, AppBar, Main, observe, SidePanel, TabBar, Root, Viewport, font, breakpoint } from '@aragon/ui' >>>>>>> import { AppBar, AppView, Main, observe, TabBar, font } from '@aragon/ui' <<<<<<< const { network, displayMenuButton } = this.props // TODO: get tokens from vault const tokens = { 0x0: 'ETH' } ======= const { network, balances } = this.props >>>>>>> const { network, displayMenuButton } = this.props <<<<<<< <Main> <AppView appBar={ <AppBar endContent={ <AppTitleButton caption="New Reward" onClick={this.newReward} /> } tabs={ <TabBar items={this.state.tabs} selected={this.state.selected} onSelect={this.selectTab} /> } > <AppBarTitle> {displayMenuButton && <MenuButton />} <AppBarLabel>Rewards</AppBarLabel> </AppBarTitle> </AppBar> } > { this.state.selected === 1 ? ( <MyRewards rewards={this.props.rewards === undefined ? [] : this.props.rewards} newReward={this.newReward} openDetails={this.openDetailsMy} network={network} tokens={tokens} /> ) : ( <Overview rewards={this.props.rewards === undefined ? [] : this.props.rewards} newReward={this.newReward} openDetails={this.openDetailsView} network={network} /> )} </AppView> <PanelManager onClose={this.closePanel} activePanel={panel} {...panelProps} /> </Main> ======= <Root.Provider> <StyledAragonApp> <AppView title="Rewards" appBar={ <AppBar endContent={ <NewRewardButton title="New Reward" onClick={this.newReward} /> } tabs={ <TabBar items={this.state.tabs} selected={this.state.selected} onChange={this.selectTab} /> } > <AppBarTitle> <Viewport> {({ below }) => below('medium') && <MenuButton onClick={this.handleMenuPanelOpen} /> } </Viewport> <AppBarLabel>Rewards</AppBarLabel> </AppBarTitle> </AppBar> } > { this.state.selected === 1 ? ( <MyRewards rewards={this.getRewards(this.props.rewards)} newReward={this.newReward} openDetails={this.openDetailsMy} network={network} onClaimReward={this.onClaimReward} tokens={this.props.balances} convertRates={this.state.convertRates} /> ) : ( <Overview rewards={this.getRewards(this.props.rewards)} newReward={this.newReward} openDetails={this.openDetailsView} network={network} tokens={this.props.balances} convertRates={this.state.convertRates} claims={this.props.claims} /> )} </AppView> <PanelManager onClose={this.closePanel} activePanel={panel} {...panelProps} /> </StyledAragonApp> </Root.Provider> >>>>>>> <Main> <AppView appBar={ <AppBar endContent={ <AppTitleButton caption="New Reward" onClick={this.newReward} /> } tabs={ <TabBar items={this.state.tabs} selected={this.state.selected} onSelect={this.selectTab} /> } > <AppBarTitle> {displayMenuButton && <MenuButton />} <AppBarLabel>Rewards</AppBarLabel> </AppBarTitle> </AppBar> } > { this.state.selected === 1 ? ( <MyRewards rewards={this.props.rewards === undefined ? [] : this.props.rewards} newReward={this.newReward} openDetails={this.openDetailsMy} network={network} onClaimReward={this.onClaimReward} tokens={this.props.balances} convertRates={this.state.convertRates} /> ) : ( <Overview rewards={this.props.rewards === undefined ? [] : this.props.rewards} newReward={this.newReward} openDetails={this.openDetailsView} network={network} tokens={this.props.balances} convertRates={this.state.convertRates} claims={this.props.claims} /> )} </AppView> <PanelManager onClose={this.closePanel} activePanel={panel} {...panelProps} /> </Main>
<<<<<<< const activities = (issue, requestsData, workSubmissions, onReviewApplication, onReviewWork) => { ======= const activities = (requestsData, workSubmissions, fundingHistory, onReviewApplication, onReviewWork) => { >>>>>>> const activities = (issue, requestsData, workSubmissions, fundingHistory, onReviewApplication, onReviewWork) => { <<<<<<< eventAction: ('review' in data) ? null : <EventButton mode="outline" onClick={() => onReviewApplication(issue, index)}> Review Application </EventButton>, ======= eventAction: ( <EventButton mode="outline" onClick={onReviewApplication}> {('review' in data) ? 'View' : 'Review'} Application </EventButton> ), >>>>>>> eventAction: ( <EventButton mode="outline" onClick={() => onReviewApplication(issue, index)}> {('review' in data) ? 'View' : 'Review'} Application </EventButton> ), <<<<<<< eventAction: ('review' in data) ? null : <EventButton mode="outline" onClick={() => onReviewWork(issue, index)}> Review Work </EventButton>, ======= eventAction: ( <EventButton mode="outline" onClick={onReviewWork}> {('review' in data) ? 'View' : 'Review'} Work </EventButton> ), >>>>>>> eventAction: ( <EventButton mode="outline" onClick={() => onReviewWork(issue, index)}> {('review' in data) ? 'View' : 'Review'} Work </EventButton> ), <<<<<<< const Detail = ({ issue, onReviewApplication, onReviewWork, onUpdateBounty, onRequestAssignment, onSubmitWork, onAllocateSingleBounty, }) => { const { workSubmissions, requestsData, url, balance, symbol, labels, title, number, repo, body, createdAt, expLevel, deadline, work, workStatus, } = issue ======= const detailsCard = issue => { >>>>>>> const detailsCard = ({ issue, onReviewApplication, onReviewWork, onUpdateBounty, onRequestAssignment, onSubmitWork, onAllocateSingleBounty, }) => {
<<<<<<< handleToggleWhitelistOnly = organization => { const {actions: {updateOrganizationAsync}} = this.props const whitelistOnly = !organization.whitelistOnly updateOrganizationAsync(organization, {...organization, whitelistOnly}) } ======= handleChooseDefaultRole = (organization, defaultRole) => { const {actions: {updateOrganizationAsync}} = this.props updateOrganizationAsync(organization, {...organization, defaultRole}) } >>>>>>> handleToggleWhitelistOnly = organization => { const {actions: {updateOrganizationAsync}} = this.props const whitelistOnly = !organization.whitelistOnly updateOrganizationAsync(organization, {...organization, whitelistOnly}) } handleChooseDefaultRole = (organization, defaultRole) => { const {actions: {updateOrganizationAsync}} = this.props updateOrganizationAsync(organization, {...organization, defaultRole}) } <<<<<<< onToggleWhitelistOnly={this.handleToggleWhitelistOnly} ======= onChooseDefaultRole={this.handleChooseDefaultRole} >>>>>>> onToggleWhitelistOnly={this.handleToggleWhitelistOnly} onChooseDefaultRole={this.handleChooseDefaultRole}
<<<<<<< ======= Button, Field, >>>>>>> <<<<<<< Button, ======= Info >>>>>>> Button, Info, <<<<<<< bounties[issue.id].size = this.calculateSize(bounties[issue.id]) } else { this.props.issues.map(issue => { bounties[issue.id] = { repo: issue.repo, number: issue.number, repoId: issue.repoId, hours: 0, exp: 0, deadline: addHours(new Date(), this.props.bountySettings.bountyDeadline), slots: 1, slotsIndex: 0, detailsOpen: 0, size: 0 } }) } ======= }) let bountySymbol = this.props.bountySettings.bountyCurrency let bountyToken, tokenDecimals, tokenBalance this.props.tokens.forEach( token => { if(token.symbol === bountySymbol) { bountyToken = token.addr tokenDecimals = token.decimals tokenBalance = token.balance } } ) >>>>>>> bounties[issue.id].size = this.calculateSize(bounties[issue.id]) } else { this.props.issues.map(issue => { bounties[issue.id] = { repo: issue.repo, number: issue.number, repoId: issue.repoId, hours: 0, exp: 0, deadline: addHours(new Date(), this.props.bountySettings.bountyDeadline), slots: 1, slotsIndex: 0, detailsOpen: 0, size: 0 } }) } let bountySymbol = this.props.bountySettings.bountyCurrency let bountyToken, tokenDecimals, tokenBalance this.props.tokens.forEach( token => { if(token.symbol === bountySymbol) { bountyToken = token.addr tokenDecimals = token.decimals tokenBalance = token.balance } } )
<<<<<<< case TEMPLATE_VARIABLE_SELECTED: { const {dashboardID, tvID, values: updatedSelectedValues} = action.payload const newDashboards = state.dashboards.map((dashboard) => { if (dashboard.id === dashboardID) { const newTVs = dashboard.tempVars.map((staleTV) => { if (staleTV.id === tvID) { const newValues = staleTV.values.map((staleValue) => { let selected = false for (let i = 0; i < updatedSelectedValues.length; i++) { if (updatedSelectedValues[i].value === staleValue.value) { selected = true break } } return {...staleValue, selected} }) return {...staleTV, values: newValues} } return staleTV }) return {...dashboard, tempVars: newTVs} } return dashboard }) return {...state, dashboards: newDashboards} } ======= case 'EDIT_TEMPLATE': { const {dashboardID, templateID, updates} = action.payload const dashboards = state.dashboards.map( d => (d.id === dashboardID ? { ...d, templates: d.templates.map( t => (t.id === templateID ? {...t, ...updates} : t) ), } : d) ) return {...state, dashboards} } >>>>>>> case TEMPLATE_VARIABLE_SELECTED: { const {dashboardID, tvID, values: updatedSelectedValues} = action.payload const newDashboards = state.dashboards.map((dashboard) => { if (dashboard.id === dashboardID) { const newTVs = dashboard.tempVars.map((staleTV) => { if (staleTV.id === tvID) { const newValues = staleTV.values.map((staleValue) => { let selected = false for (let i = 0; i < updatedSelectedValues.length; i++) { if (updatedSelectedValues[i].value === staleValue.value) { selected = true break } } return {...staleValue, selected} }) return {...staleTV, values: newValues} } return staleTV }) return {...dashboard, tempVars: newTVs} } return dashboard }) return {...state, dashboards: newDashboards} } case 'EDIT_TEMPLATE': { const {dashboardID, templateID, updates} = action.payload const dashboards = state.dashboards.map( d => (d.id === dashboardID ? { ...d, templates: d.templates.map( t => (t.id === templateID ? {...t, ...updates} : t) ), } : d) ) return {...state, dashboards} }
<<<<<<< ======= //overflow-y: hidden; >>>>>>>
<<<<<<< import { observe, SidePanel, Main, AppBar, AppView, breakpoint } from '@aragon/ui' ======= import { observe, SidePanel, Main, AppBar, AppView } from '@aragon/ui' >>>>>>> import { observe, SidePanel, Main, AppBar, AppView } from '@aragon/ui' <<<<<<< <IdentityProvider onResolve={this.handleResolveLocalIdentity} onShowLocalIdentityModal={this.handleShowLocalIdentityModal}> <AppView padding={0} appBar={ <AppBar endContent={ <AppTitleButton caption="New Entity" onClick={this.newEntity} /> } > <AppTitle title="Address Book" displayMenuButton={displayMenuButton} /> </AppBar> } > <ScrollWrapper> <Entities entities={entries ? entries : []} onNewEntity={this.newEntity} onRemoveEntity={this.removeEntity} /> </ScrollWrapper> </AppView> <SidePanel title="New entity" opened={panelVisible} onClose={this.closePanel} > <NewEntity onCreateEntity={this.createEntity} /> </SidePanel> </IdentityProvider> ======= <AppView appBar={ <AppBar endContent={ <AppTitleButton caption="New Entity" onClick={this.newEntity} /> } > <AppTitle title="Address Book" displayMenuButton={displayMenuButton} css="padding-left: 30px" /> </AppBar> } > <ScrollWrapper> <Entities entities={entries ? entries : []} onNewEntity={this.newEntity} onRemoveEntity={this.removeEntity} /> </ScrollWrapper> </AppView> <SidePanel title="New entity" opened={panelVisible} onClose={this.closePanel} > <NewEntity onCreateEntity={this.createEntity} /> </SidePanel> >>>>>>> <IdentityProvider onResolve={this.handleResolveLocalIdentity} onShowLocalIdentityModal={this.handleShowLocalIdentityModal}> <AppView padding={0} appBar={ <AppBar endContent={ <AppTitleButton caption="New Entity" onClick={this.newEntity} /> } > <AppTitle title="Address Book" displayMenuButton={displayMenuButton} css="padding-left: 30px" /> </AppBar> } > <ScrollWrapper> <Entities entities={entries ? entries : []} onNewEntity={this.newEntity} onRemoveEntity={this.removeEntity} /> </ScrollWrapper> </AppView> <SidePanel title="New entity" opened={panelVisible} onClose={this.closePanel} > <NewEntity onCreateEntity={this.createEntity} /> </SidePanel> </IdentityProvider>
<<<<<<< onNewReward = reward => { this.props.app.newReward( reward.isMerit, //bool _isMerit, reward.referenceAsset, //address _referenceToken, reward.currency, //address _rewardToken, reward.amount, //uint _amount, reward.duration, //uint _duration, (number of blocks until reward will be available) 1, //uint _occurances, 0 //uint _delay ) this.closePanel() } ======= >>>>>>>
<<<<<<< const handleSubmit = async e => { e.preventDefault() const newIssueData = { number: issues.filter(i => i.id === repoHexIds[selectedProject - 1]).length, id: repoHexIds[selectedProject - 1], title, body: description, author: { login: this.props.account, }, repository: reposManaged[selectedProject - 1], labels: { totalCount: 0, edges: Array(0) }, milestone: null, state: 'OPEN', url: null } const hashedIssueData = await ipfsAdd(newIssueData) api.setIssue(newIssueData.id, newIssueData.number, hashedIssueData).toPromise() } // TODO: refetch Issues list after mutation ======= const [ newIssue, { loading, error }] = this.props.graphqlMutation if (loading) return <Creating /> if (error) return <div css={`margin-top: ${3 * GU}px`}>Error</div> >>>>>>> const handleSubmit = async e => { e.preventDefault() const newIssueData = { number: issues.filter(i => i.id === repoHexIds[selectedProject - 1]).length, id: repoHexIds[selectedProject - 1], title, body: description, author: { login: this.props.account, }, repository: reposManaged[selectedProject - 1], labels: { totalCount: 0, edges: Array(0) }, milestone: null, state: 'OPEN', url: null } const hashedIssueData = await ipfsAdd(newIssueData) api.setIssue(newIssueData.id, newIssueData.number, hashedIssueData).toPromise() } // TODO: refetch Issues list after mutation const [ newIssue, { loading, error }] = this.props.graphqlMutation if (loading) return <Creating /> if (error) return <div css={`margin-top: ${3 * GU}px`}>Error</div> <<<<<<< <div css={`margin: ${2 * GU}px 0`}> <Field label="Project"> <DropDown items={items} selected={selectedProject} onChange={projectChange} wide required /> </Field> {selectedProject > 0 && (reposManaged[selectedProject - 1].decoupled ? ( /* Repo is Decoupled */ <Form onSubmit={handleSubmit} submitText="Submit Issue" submitDisabled={this.canSubmit()} > <Field label="Title"> <TextInput onChange={titleChange} required wide /> </Field> <Field label="Description"> <TextInput.Multiline rows={3} style={{ resize: 'none', height: 'auto', paddingTop: '5px', paddingBottom: '5px', }} onChange={descriptionChange} wide /> </Field> </Form> ) : ( /* repo is connected to github */ <Mutation mutation={NEW_ISSUE} variables={{ title, description, id }} onError={console.error} > {(newIssue, result) => { const { data, loading, error, called } = result if (!called) { return ( <Form onSubmit={newIssue} submitText="Submit Issue" submitDisabled={this.canSubmit()} > <Field label="Title"> <TextInput onChange={titleChange} required wide /> </Field> <Field label="Description"> <TextInput.Multiline rows={3} style={{ resize: 'none', height: 'auto', paddingTop: '5px', paddingBottom: '5px', }} onChange={descriptionChange} wide /> </Field> </Form> ) } // end if(!called) if (loading) { return <Creating /> } if (error) { return <div>Error</div> } const { createIssue } = data if (createIssue) { this.props.closePanel() } return null }} </Mutation> ))} </div> ======= <Form css={`margin-top: ${3 * GU}px`} onSubmit={async () => { await newIssue({ variables: { title, description, id } }) this.props.closePanel() }} submitText="Submit Issue" submitDisabled={this.canSubmit()} > <Field label="Project"> <DropDown items={items} selected={selectedProject} onChange={projectChange} wide required /> </Field> <Field label="Title"> <TextInput onChange={titleChange} required wide /> </Field> <Field label="Description"> <TextInput.Multiline rows={3} style={{ resize: 'none', height: 'auto', paddingTop: '5px', paddingBottom: '5px', }} onChange={descriptionChange} wide /> </Field> </Form> >>>>>>> <Form css={`margin-top: ${3 * GU}px`} onSubmit={async () => { await newIssue({ variables: { title, description, id } }) this.props.closePanel() }} submitText="Submit Issue" submitDisabled={this.canSubmit()} > <Field label="Project"> <DropDown items={items} selected={selectedProject} onChange={projectChange} wide required /> </Field> {selectedProject > 0 && (reposManaged[selectedProject - 1].decoupled ? ( /* Repo is Decoupled */ <Form onSubmit={handleSubmit} submitText="Submit Issue" submitDisabled={this.canSubmit()} > <Field label="Title"> <TextInput onChange={titleChange} required wide /> </Field> <Field label="Description"> <TextInput.Multiline rows={3} style={{ resize: 'none', height: 'auto', paddingTop: '5px', paddingBottom: '5px', }} onChange={descriptionChange} wide /> </Field> </Form> ) : ( /* repo is connected to github */ <Mutation mutation={NEW_ISSUE} variables={{ title, description, id }} onError={console.error} > {(newIssue, result) => { const { data, loading, error, called } = result if (!called) { return ( <Form onSubmit={newIssue} submitText="Submit Issue" submitDisabled={this.canSubmit()} > <Field label="Title"> <TextInput onChange={titleChange} required wide /> </Field> <Field label="Description"> <TextInput.Multiline rows={3} style={{ resize: 'none', height: 'auto', paddingTop: '5px', paddingBottom: '5px', }} onChange={descriptionChange} wide /> </Field> </Form> ) } // end if(!called) if (loading) { return <Creating /> } if (error) { return <div>Error</div> } const { createIssue } = data if (createIssue) { this.props.closePanel() } return null }} </Mutation> ))} </Form> <<<<<<< const { appState: { github, issues }, api, connectedAccount } = useAragonApi() ======= const { appState: { github } } = useAragonApi() const graphqlMutation = useMutation(NEW_ISSUE, { onError: console.error, refetchQueries: ['SearchIssues'], // TODO: doesn't work; needs delay before refetch }) >>>>>>> const { appState: { github, issues }, api, connectedAccount } = useAragonApi() const graphqlMutation = useMutation(NEW_ISSUE, { onError: console.error, refetchQueries: ['SearchIssues'], // TODO: doesn't work; needs delay before refetch })
<<<<<<< () => { this.props.app.cache('github', { status: STATUS.FAILED, token: null, }) } ) ======= }, () => { this.props.app.cache('github', { event: REQUESTED_GITHUB_TOKEN_FAILURE, status: STATUS.FAILED, token: null, }) }) >>>>>>> () => { this.props.app.cache('github', { event: REQUESTED_GITHUB_TOKEN_FAILURE, status: STATUS.FAILED, token: null, }) }) <<<<<<< let bountyToken, bountyDecimals this.props.tokens.forEach(token => { if (token.symbol === bountySymbol) { bountyToken = token.addr bountyDecimals = token.decimals } }) for (let key in issues) issuesArray.push({ key: key, ...issues[key] }) ======= >>>>>>> let bountyToken, bountyDecimals this.props.tokens.forEach(token => { if (token.symbol === bountySymbol) { bountyToken = token.addr bountyDecimals = token.decimals } }) for (let key in issues) issuesArray.push({ key: key, ...issues[key] }) <<<<<<< console.log('Submit issues:', issuesArray) ======= >>>>>>> console.log('Submit issues:', issuesArray) <<<<<<< console.log( 'onReviewWork', ipfsData.review, web3.toHex(issue.repoId), issue.number, issue.workSubmissions[issue.workSubmissions.length - 1], state.accepted, requestIPFSHash ) ======= >>>>>>>
<<<<<<< const expLevelsMul = expLevels.map(l => web3.toHex(l.mul) * 100) ======= let expLevelsMul = expLevels.map(l => web3.toHex(l.mul)) >>>>>>> const expLevelsMul = expLevels.map(l => web3.toHex(l.mul) * 100) <<<<<<< bountyCurrencies[bountyCurrency], bountyAllocator ======= this.props.tokens[bountyCurrency].addr, bountyAllocator, >>>>>>> this.props.tokens[bountyCurrency].addr, bountyAllocator
<<<<<<< import { Button, DropDown, IconClose, IconFundraising, IdentityBadge, Info, SafeLink, Text, TextInput, useTheme, } from '@aragon/ui' ======= import { DropDown, IconClose, Text, TextInput, useTheme, } from '@aragon/ui' >>>>>>> import { Button, DropDown, IconClose, IdentityBadge, Info, Text, TextInput, useTheme, } from '@aragon/ui' <<<<<<< import { DateInput, InputDropDown } from '../../../../../../shared/ui' import { format } from 'date-fns' import moment from 'moment' import BigNumber from 'bignumber.js' import { MILLISECONDS_IN_A_MONTH, MILLISECONDS_IN_A_QUARTER, millisecondsToBlocks, millisecondsToMonths, millisecondsToQuarters, } from '../../../../../../shared/ui/utils' import { toCurrency } from '../../../utils/helpers' ======= import { DateInput } from '../../../../../../shared/ui' import moment from 'moment' >>>>>>> import { DateInput } from '../../../../../../shared/ui' import moment from 'moment' <<<<<<< changeField = ({ target: { name, value } }) => { this.setState({ [name]: value }) if (name === "amount") this.setSemanticErrors({ amount: value }) } setDisbursements = (dateStart, dateEnd, disbursement, disbursementUnit) => { if (isNaN(disbursement) || disbursement <= 0 || this.state.rewardType !== RECURRING_DIVIDEND) { this.setState({ disbursements: []}) return } let disbursements = [], date = moment(dateStart).add(disbursement, disbursementUnit) while (date.isBefore(dateEnd)) { disbursements.push(date.clone()) date.add(disbursement, disbursementUnit) } this.setState({ disbursements, disbursementsInexistent: disbursements.length === 0, }) this.setSemanticErrors({ dateStart, dateEnd, disbursements }) } dropDownItems = (name) => { if (name == "amountToken") { return this.props.amountTokens.map(token => token.symbol) } return this.props[name + 's'] } dropDownSelect = (name) => { return this.props[name + 's'].indexOf(this.state[name]) } dropDownChange = (name, index) => { this.setState({ [name]: this.props[name + 's'][index], }) } ======= >>>>>>> changeField = ({ target: { name, value } }) => { this.setState({ [name]: value }) if (name === "amount") this.setSemanticErrors({ amount: value }) } setDisbursements = (dateStart, dateEnd, disbursement, disbursementUnit) => { if (isNaN(disbursement) || disbursement <= 0 || this.state.rewardType !== RECURRING_DIVIDEND) { this.setState({ disbursements: []}) return } let disbursements = [], date = moment(dateStart).add(disbursement, disbursementUnit) while (date.isBefore(dateEnd)) { disbursements.push(date.clone()) date.add(disbursement, disbursementUnit) } this.setState({ disbursements, disbursementsInexistent: disbursements.length === 0, }) this.setSemanticErrors({ dateStart, dateEnd, disbursements }) } dropDownItems = (name) => { if (name == "amountToken") { return this.props.amountTokens.map(token => token.symbol) } return this.props[name + 's'] } dropDownSelect = (name) => { return this.props[name + 's'].indexOf(this.state[name]) } dropDownChange = (name, index) => { this.setState({ [name]: this.props[name + 's'][index], }) } <<<<<<< showSummary = () => (this.state.referenceAsset > 1 || this.state.customToken.symbol) getReferenceAssets() { ======= getReferenceAssets() { >>>>>>> showSummary = () => (this.state.referenceAsset > 1 || this.state.customToken.symbol) getReferenceAssets() { <<<<<<< ErrorBox = () => ( this.errorPrompt() && <React.Fragment> <Info.Alert> {this.startBeforeTokenCreation() && `The selected start date occurs before your reference asset ${(getTokenProp('symbol',this.props,this.state))} was created. Please choose another date.`} {this.disbursementOverflow() && `You have specified a date range that results in ${this.state.quarterEndDates.length} disbursements, yet our system can only handle 41. Choose an end date no later than ${this.formatDate(this.state.quarterEndDates[40])}.`} {this.lowVaultBalance() && `You have specified a reward for ${this.state.amount} ${this.props.balances[this.state.amountCurrency].symbol}, yet your vault balance is ${this.props.balances[this.state.amountCurrency].amount / Math.pow(10,this.props.balances[this.state.amountCurrency].decimals)} ${this.props.balances[this.state.amountCurrency].symbol}. To ensure successful execution, specify another amount that does not exceed your balance.`} {this.dividendPeriodTooShort() && 'Please select a start and end date that are at least as long as the cycle period selected'} </Info.Alert> <br /> </React.Fragment> ) amountWithTokenAndBalance = () => ( <VerticalContainer> <HorizontalContainer> <TextInput name="amount" type="number" min={MIN_AMOUNT} step="any" onChange={this.changeField} wide={true} value={this.state.amount} css={{ borderRadius: '4px 0px 0px 4px' }} /> <DropDown name="amountToken" css={{ borderRadius: '0px 4px 4px 0px' }} items={this.dropDownItems("amountToken")} selected={this.dropDownSelect("amountToken")} onChange={i => { this.dropDownChange("amountToken", i) this.setSemanticErrors({amountToken: this.props.amountTokens[i]}) }} /> </HorizontalContainer> <Text size="small" color={this.props.theme.contentSecondary} css={{ alignSelf: 'flex-end', marginTop: '8px', }} > {'Available Balance: '} {this.state.amountToken.balance} {this.state.amountToken.symbol} </Text> </VerticalContainer> ) startAndEndDate = () => ( <HorizontalContainer> ======= startAndEndDate = () => ( <HorizontalContainer> >>>>>>> ErrorBox = () => ( this.errorPrompt() && <React.Fragment> <Info.Alert> {this.startBeforeTokenCreation() && `The selected start date occurs before your reference asset ${(getTokenProp('symbol',this.props,this.state))} was created. Please choose another date.`} {this.disbursementOverflow() && `You have specified a date range that results in ${this.state.quarterEndDates.length} disbursements, yet our system can only handle 41. Choose an end date no later than ${this.formatDate(this.state.quarterEndDates[40])}.`} {this.lowVaultBalance() && `You have specified a reward for ${this.state.amount} ${this.props.balances[this.state.amountCurrency].symbol}, yet your vault balance is ${this.props.balances[this.state.amountCurrency].amount / Math.pow(10,this.props.balances[this.state.amountCurrency].decimals)} ${this.props.balances[this.state.amountCurrency].symbol}. To ensure successful execution, specify another amount that does not exceed your balance.`} {this.dividendPeriodTooShort() && 'Please select a start and end date that are at least as long as the cycle period selected'} </Info.Alert> <br /> </React.Fragment> ) amountWithTokenAndBalance = () => ( <VerticalContainer> <HorizontalContainer> <TextInput name="amount" type="number" min={MIN_AMOUNT} step="any" onChange={this.changeField} wide={true} value={this.state.amount} css={{ borderRadius: '4px 0px 0px 4px' }} /> <DropDown name="amountToken" css={{ borderRadius: '0px 4px 4px 0px' }} items={this.dropDownItems("amountToken")} selected={this.dropDownSelect("amountToken")} onChange={i => { this.dropDownChange("amountToken", i) this.setSemanticErrors({amountToken: this.props.amountTokens[i]}) }} /> </HorizontalContainer> <Text size="small" color={this.props.theme.contentSecondary} css={{ alignSelf: 'flex-end', marginTop: '8px', }} > {'Available Balance: '} {this.state.amountToken.balance} {this.state.amountToken.symbol} </Text> </VerticalContainer> ) startAndEndDate = () => ( <HorizontalContainer> <<<<<<< oneTimeDividend = () => ( <VerticalContainer> <FormField required label="Total amount" input={this.amountWithTokenAndBalance()} /> ======= oneTimeDividend = () => ( <VerticalContainer> >>>>>>> oneTimeDividend = () => ( <VerticalContainer> <FormField required label="Total amount" input={this.amountWithTokenAndBalance()} /> <<<<<<< oneTimeMerit = () => ( <VerticalContainer> <FormField required label="Total amount" input={this.amountWithTokenAndBalance()} /> {this.startAndEndDate()} </VerticalContainer> ) fieldsToDisplay = () => { const { rewardType } = this.state switch (rewardType) { case ONE_TIME_DIVIDEND: return this.oneTimeDividend() case RECURRING_DIVIDEND: return this.recurringDividend() case ONE_TIME_MERIT: return this.oneTimeMerit() default: return <div /> } } submitDraft = () => { this.setState({ draftSubmitted: true }) } errorBlocks = () => { const { semanticErrors, errorMessages } = this.state return semanticErrors.map((error, i) => ( <ErrorText key={i}> <IconContainer> <IconClose size="tiny" css={{ marginRight: '8px', color: this.props.theme.negative, }} /> </IconContainer> <Text>{errorMessages[error]}</Text> </ErrorText> )) } showDraft = () => { const { rewardType, disbursements, } = this.state return ( <Form onSubmit={this.submitDraft} submitText="Continue" disabled={!this.isDraftValid()} errors={this.errorBlocks()} > ======= oneTimeMerit = () => ( <VerticalContainer> <FormField required label="Total amount" input={this.amountWithTokenAndBalance()} /> {this.startAndEndDate()} </VerticalContainer> ) fieldsToDisplay = () => { const { rewardType } = this.state switch (rewardType) { case ONE_TIME_DIVIDEND: return this.oneTimeDividend() case RECURRING_DIVIDEND: return this.recurringDividend() case ONE_TIME_MERIT: return this.oneTimeMerit() default: return <div /> } } errorBlocks = () => { const { semanticErrors, errorMessages } = this.state return semanticErrors.map((error, i) => ( <ErrorText key={i}> <IconContainer> <IconClose size="tiny" css={{ marginRight: '8px', color: this.props.theme.negative, }} /> </IconContainer> <Text>{errorMessages[error]}</Text> </ErrorText> )) } showDraft = () => { const { rewardType } = this.state return ( <Form onSubmit={this.submitDraft} submitText="Continue" disabled={!this.isDraftValid()} errors={this.errorBlocks()} > <VerticalSpace /> >>>>>>> oneTimeMerit = () => ( <VerticalContainer> <FormField required label="Total amount" input={this.amountWithTokenAndBalance()} /> {this.startAndEndDate()} </VerticalContainer> ) fieldsToDisplay = () => { const { rewardType } = this.state switch (rewardType) { case ONE_TIME_DIVIDEND: return this.oneTimeDividend() case RECURRING_DIVIDEND: return this.recurringDividend() case ONE_TIME_MERIT: return this.oneTimeMerit() default: return <div /> } } errorBlocks = () => { const { semanticErrors, errorMessages } = this.state return semanticErrors.map((error, i) => ( <ErrorText key={i}> <IconContainer> <IconClose size="tiny" css={{ marginRight: '8px', color: this.props.theme.negative, }} /> </IconContainer> <Text>{errorMessages[error]}</Text> </ErrorText> )) } showDraft = () => { const { rewardType } = this.state return ( <Form onSubmit={this.submitDraft} submitText="Continue" disabled={!this.isDraftValid()} errors={this.errorBlocks()} > <VerticalSpace /> <<<<<<< <TextInput name="description" wide multiline placeholder="Briefly describe this reward." value={this.state.description} onChange={this.changeField} ======= <TextInput name="description" wide multiline placeholder="Briefly describe this reward." value={this.state.description} onChange={e => this.setState({ description: e.target.value })} >>>>>>> <TextInput name="description" wide multiline placeholder="Briefly describe this reward." value={this.state.description} onChange={e => this.setState({ description: e.target.value })} <<<<<<< const IconContainer = styled.div`` const NewReward = props => { const theme = useTheme() return <NewRewardClass theme={theme} {...props} /> } ======= const IconContainer = styled.div` display: flex; ` const NewReward = props => { const theme = useTheme() return <NewRewardClass theme={theme} {...props} /> } >>>>>>> const IconContainer = styled.div` display: flex; ` const NewReward = props => { const theme = useTheme() return <NewRewardClass theme={theme} {...props} /> }
<<<<<<< let bobafettInitialBalance, dengarInitialBalance, bosskInitialBalance, allocationId, supports, token ======= let bobafettInitialBalance let dengarInitialBalance let bosskInitialBalance let accountId let payoutId let supports >>>>>>> let bobafettInitialBalance, dengarInitialBalance, bosskInitialBalance, accountId, payoutId, supports, token <<<<<<< candidateAddresses = [ bobafett, dengar, bossk ] ======= candidateAddresses = [ bobafett, dengar, bossk ] >>>>>>> candidateAddresses = [ bobafett, dengar, bossk ] <<<<<<< it('cannot set Distribution before funding the account (eth)', async () => { supports = [ 500, 200, 300 ] ======= it('cannot set Distribution before funding the account', async () => { supports = [ 500, 200, 300 ] >>>>>>> it('cannot set Distribution before funding the account (eth)', async () => { supports = [ 500, 200, 300 ] <<<<<<< it('cannot execute payout before Distribution is set', async () => { await app.fund(allocationId, { from: empire, value: web3.toWei(3.00, 'ether'), }) return assertRevert(async () => { await app.runPayout(allocationId, { from: empire }) }) }) }) }) context('Informational Payout', () => { const empire = accounts[0] const bobafett = accounts[1] const dengar = accounts[2] const bossk = accounts[3] let allocationId let supports before(async () => { candidateAddresses = [ bobafett, dengar, bossk ] }) beforeEach(async () => { allocationId = (await app.newPayout( 'Fett\'s auto warranty', )).logs[0].args.accountId.toNumber() }) it('can create new Payout', async () => { payoutMembers = await app.getPayout(allocationId) assert.equal( payoutMembers[1], 'Fett\'s auto warranty', 'Payout metadata incorrect' ) assert.equal(payoutMembers[0].toNumber(), 0, 'Payout Balance Incorrect') }) it('sets the distribution', async () => { supports = [ 300, 400, 300 ] totalsupport = 1000 const zeros = new Array(candidateAddresses.length).fill(0) await app.setDistribution( candidateAddresses, supports, zeros, '', zeros, zeros, allocationId, true, false, 0, 0, 0x0, { from: empire }, ) const candidateArrayLength = (await app.getNumberOfCandidates( allocationId )).toNumber() let storedSupport = [] let supportVal for (let i = 0; i < candidateArrayLength; i++) { supportVal = (await app.getPayoutDistributionValue( allocationId, i )).toNumber() assert.equal( supports[i], supportVal, 'support distributions do not match what is specified' ) storedSupport.push(supportVal) } assert.equal( supports.length, storedSupport.length, 'distribution array lengths do not match' ) }) it('cannot accept funds via a fund call', async () => { supports = [ 300, 400, 300 ] const zeros = new Array(candidateAddresses.length).fill(0) await app.setDistribution( candidateAddresses, supports, zeros, '', zeros, zeros, allocationId, true, false, 0, 0, 0x0, { from: empire }, ) return assertRevert(async () => { await app.fund(allocationId, { from: empire, value: web3.toWei(0.01, 'ether') }) }) }) it('cannot accept funds via setDistribution', async () => { //assertrevert when attempt to add funds supports = [ 300, 400, 300 ] totalsupport = 1000 const zeros = new Array(candidateAddresses.length).fill(0) return assertRevert(async () => { await app.setDistribution( candidateAddresses, supports, zeros, '', zeros, zeros, allocationId, true, false, 0, 0, 0x0, { from: empire, value: web3.toWei(0.01, 'ether') } ) }) }) it('cannot execute', async () => { // assertrevert an attempt to run runPayout for an informational vote return assertRevert(async () => { await app.runPayout(allocationId) }) ======= >>>>>>> <<<<<<< it('cannot occur more frequently than daily', async () => { supports = [ 300, 400, 300 ] ======= xit('cannot occur more frequently than daily', async () => { supports = [ 300, 400, 300 ] >>>>>>> it('cannot occur more frequently than daily', async () => { supports = [ 300, 400, 300 ] <<<<<<< 0x0, { from: empire, value: web3.toWei(0.01, 'ether') } ======= { from: empire, } >>>>>>> 0x0, { from: empire, } <<<<<<< web3.toWei(0.01, 'ether'), 0x0 ) ======= web3.toWei(0.01, 'ether') )).logs[0].args.payoutId.toNumber() >>>>>>> web3.toWei(0.01, 'ether'), 0x0 )).logs[0].args.payoutId.toNumber()
<<<<<<< let appState, vault, bounties, tokens, vaultAddress ======= let appState = determineStateVars() let vault, bounties, tokens >>>>>>> let appState = determineStateVars() let vault, bounties, tokens, vaultAddress <<<<<<< if (response.address === vaultAddress) { console.log('[Projects] VaultDeposit', vault) nextState = await syncTokens(appState, response.returnValues) appState = resetAppState(nextState) } ======= console.log('[Projects] VaultDeposit') nextState = await syncTokens(cloneAppState(appState), response.returnValues) appState = cloneAppState(nextState) >>>>>>> if (response.address === vaultAddress) { console.log('[Projects] VaultDeposit', vault) nextState = await syncTokens(cloneAppState(appState), response.returnValues) appState = cloneAppState(nextState) } <<<<<<< if(nextState) { console.log('[Projects] current state: ',nextState) app.cache('state', nextState) } ======= app.cache('state', nextState) >>>>>>> if(nextState) { console.log('[Projects] current state: ',nextState) app.cache('state', nextState) }
<<<<<<< hint={isMerit && <span>The <b>start date</b> for one-time merits defines the beginning of the review period in which newly accrued amounts of the reference asset will be determined.</span>} ======= width={`calc(50% - ${GU}px)`} >>>>>>> hint={isMerit && <span>The <b>start date</b> for one-time merits defines the beginning of the review period in which newly accrued amounts of the reference asset will be determined.</span>} width={`calc(50% - ${GU}px)`} <<<<<<< hint={isMerit && <span>The <b>end date</b> for one-time merits defines the end of the review period in which newly accrued amounts of the reference asset will be determined.</span>} ======= width={`calc(50% - ${GU}px)`} >>>>>>> hint={isMerit && <span>The <b>end date</b> for one-time merits defines the end of the review period in which newly accrued amounts of the reference asset will be determined.</span>} width={`calc(50% - ${GU}px)`}
<<<<<<< disbursements, semanticErrors, ======= errors, >>>>>>> disbursements, errors, <<<<<<< <React.Fragment> <Form onSubmit={this.submitDraft} submitText="Continue" disabled={!this.isDraftValid()} errors={ <React.Fragment> { this.errorBlocks() } { this.warningBlocks() } </React.Fragment> ======= <Form onSubmit={this.submitDraft} submitText="Continue" disabled={!this.isDraftValid()} errors={ <React.Fragment> { this.errorBlocks() } { this.warningBlocks() } </React.Fragment> } > <VerticalSpace /> <FormField label="Description" required input={ <TextInput name="description" wide multiline placeholder="Briefly describe this reward." value={this.state.description} onChange={e => this.setState({ description: e.target.value })} /> } /> <FormField required wide label="Reference Asset" hint={<span>The <b>reference asset</b> is the token that members will be required to hold in order to receive the reward. For example, if the reference asset is ANT, then any member that holds ANT at the reference date(s) will be eligible to receive the reward. The reference asset is not the token to be paid as reward amount.</span>} input={ <DropDown name="referenceAsset" wide items={this.state.referenceAssets} selected={this.state.referenceAssets.indexOf(this.state.referenceAsset)} placeholder="Select a token" onChange={async (i) => { const referenceAsset = this.state.referenceAssets[i] this.setState({ referenceAsset }) if (referenceAsset !== OTHER) await this.verifyTransferable(this.props.app, referenceAsset.key) this.setErrors({ referenceAsset }) }} /> } /> {this.state.referenceAsset === OTHER && ( <React.Fragment> <FormField label={this.onMainNet() ? this.state.labelCustomToken : 'TOKEN ADDRESS'} required input={ <TextInput name="customToken" placeholder={this.onMainNet() ? 'SYM…' : ''} wide value={this.state.customToken.value} onChange={this.handleCustomTokenChange} /> } /> </React.Fragment> )} <FormField required label="Type" hint="Rewards can either be dividends or merits. Dividends are rewards that are distributed based on holding the reference asset at the reference date(s), and they can either be one-time or recurring. Merits can only be one-time, and are based on the newly accrued amount of a particular token over a specified period of time." input={ <DropDown wide name="rewardType" items={REWARD_TYPES} selected={REWARD_TYPES.indexOf(rewardType)} placeholder="Select type of reward" onChange={i => { this.setState({ rewardType: REWARD_TYPES[i] }) this.setErrors({ rewardType: REWARD_TYPES[i] }) }} /> >>>>>>> <React.Fragment> <Form onSubmit={this.submitDraft} submitText="Continue" disabled={!this.isDraftValid()} errors={ <React.Fragment> { this.errorBlocks() } { this.warningBlocks() } </React.Fragment>
<<<<<<< <Root.Provider> <StyledAragonApp publicUrl={ASSETS_URL}> <BaseStyles /> <ToastHub> <Title text="Projects" /> <ApolloProvider client={client}> <ErrorBoundary> <AppContent onLogin={this.handleGithubSignIn} status={this.props.github.status || STATUS.INITIAL} app={this.props.app} bountySettings={bountySettings} githubCurrentUser={githubCurrentUser || {}} githubLoading={this.state.githubLoading} projects={this.props.repos !== undefined ? this.props.repos : []} bountyIssues={ this.props.issues !== undefined ? this.props.issues : [] } bountySettings={ bountySettings !== undefined ? bountySettings : {} } tokens={this.props.tokens !== undefined ? this.props.tokens : []} onNewProject={this.newProject} onRemoveProject={this.removeProject} onNewIssue={this.newIssue} onCurateIssues={this.curateIssues} onAllocateBounties={this.newBountyAllocation} onSubmitWork={this.submitWork} onRequestAssignment={this.requestAssignment} activeIndex={activeIndex} changeActiveIndex={this.changeActiveIndex} onReviewApplication={this.reviewApplication} onReviewWork={this.reviewWork} /> <PanelManager onClose={this.closePanel} activePanel={panel} {...panelProps} /> </ErrorBoundary> </ApolloProvider> </ToastHub> </StyledAragonApp> </Root.Provider> ======= <StyledAragonApp publicUrl={ASSETS_URL}> <BaseStyles /> <ToastHub> <Title text="Projects" /> <ApolloProvider client={client}> <ErrorBoundary> <AppContent onLogin={this.handleGithubSignIn} status={this.props.github.status || STATUS.INITIAL} app={this.props.app} bountySettings={bountySettings} githubCurrentUser={githubCurrentUser || {}} projects={this.props.repos !== undefined ? this.props.repos : []} bountyIssues={ this.props.issues !== undefined ? this.props.issues : [] } bountySettings={ bountySettings !== undefined ? bountySettings : {} } tokens={this.props.tokens !== undefined ? this.props.tokens : []} onNewProject={this.newProject} onRemoveProject={this.removeProject} onNewIssue={this.newIssue} onCurateIssues={this.curateIssues} onAllocateBounties={this.newBountyAllocation} onSubmitWork={this.submitWork} onRequestAssignment={this.requestAssignment} activeIndex={activeIndex} changeActiveIndex={this.changeActiveIndex} onReviewApplication={this.reviewApplication} onReviewWork={this.reviewWork} /> <PanelManager onClose={this.closePanel} activePanel={panel} {...panelProps} /> </ErrorBoundary> </ApolloProvider> </ToastHub> </StyledAragonApp> >>>>>>> <StyledAragonApp publicUrl={ASSETS_URL}> <BaseStyles /> <ToastHub> <Title text="Projects" /> <ApolloProvider client={client}> <ErrorBoundary> <AppContent onLogin={this.handleGithubSignIn} status={this.props.github.status || STATUS.INITIAL} app={this.props.app} bountySettings={bountySettings} githubCurrentUser={githubCurrentUser || {}} githubLoading={this.state.githubLoading} projects={this.props.repos !== undefined ? this.props.repos : []} bountyIssues={ this.props.issues !== undefined ? this.props.issues : [] } bountySettings={ bountySettings !== undefined ? bountySettings : {} } tokens={this.props.tokens !== undefined ? this.props.tokens : []} onNewProject={this.newProject} onRemoveProject={this.removeProject} onNewIssue={this.newIssue} onCurateIssues={this.curateIssues} onAllocateBounties={this.newBountyAllocation} onSubmitWork={this.submitWork} onRequestAssignment={this.requestAssignment} activeIndex={activeIndex} changeActiveIndex={this.changeActiveIndex} onReviewApplication={this.reviewApplication} onReviewWork={this.reviewWork} /> <PanelManager onClose={this.closePanel} activePanel={panel} {...panelProps} /> </ErrorBoundary> </ApolloProvider> </ToastHub> </StyledAragonApp>
<<<<<<< renderRefreshingGraph(type, queries) { const {autoRefresh, templates, synchronizer} = this.props ======= renderRefreshingGraph(type, queries, cellHeight) { const {timeRange, autoRefresh, templates} = this.props >>>>>>> renderRefreshingGraph(type, queries, cellHeight) { const {timeRange, autoRefresh, templates, synchronizer} = this.props
<<<<<<< var CartoError = require('../error'); var metadataParser = require('./metadata/parser'); ======= var CartoError = require('../error-handling/carto-error'); var CartoValidationError = require('../error-handling/carto-validation-error'); var EVENTS = require('../events'); >>>>>>> var CartoError = require('../error-handling/carto-error'); var CartoValidationError = require('../error-handling/carto-validation-error'); var EVENTS = require('../events'); var metadataParser = require('./metadata/parser');
<<<<<<< var options = JSON.parse(data.options); options.allowWheelOnFullscreen = false; ======= var options = data.options; >>>>>>> var options = data.options; options.allowWheelOnFullscreen = false;
<<<<<<< var CartoValidationError = require('../error-handling/carto-error'); ======= var CartoError = require('../error'); // Event constants var CONTENT_CHANGED = 'contentChanged'; >>>>>>> var CartoValidationError = require('../error-handling/carto-error'); var CartoError = require('../error-handling/carto-error'); // Event constants var CONTENT_CHANGED = 'contentChanged';
<<<<<<< var Backbone = require('backbone'); var VisModel = require('../../../../src/vis/vis'); ======= var LayersCollection = require('../../../../src/geo/map/layers'); >>>>>>> var VisModel = require('../../../../src/vis/vis'); var LayersCollection = require('../../../../src/geo/map/layers');
<<<<<<< // TODO: change Dropdown to a MultiSelectDropdown, `selected` to // the full array, and [item] to all `selected` values when we update // this component to support multiple values return ( <div key={id} className="template-control--dropdown"> <Dropdown items={items} buttonSize="btn-xs" selected={selectedText || 'Loading...'} onChoose={item => onSelectTemplate(id, [item].map(x => omit(x, 'text')))} /> <label className="template-control--label"> {tempVar} </label> </div> ) }) : <div className="template-control--empty"> This dashboard does not have any Template Variables </div>} </div> <button className="btn btn-primary btn-sm template-control--manage" onClick={onOpenTemplateManager} > <span className="icon cog-thick" /> Manage </button> ======= // TODO: change Dropdown to a MultiSelectDropdown, `selected` to // the full array, and [item] to all `selected` values when we update // this component to support multiple values return ( <div key={id} className="template-control--dropdown"> <Dropdown items={items} buttonSize="btn-xs" useAutoComplete={true} selected={selectedText || '(No values)'} onChoose={item => onSelectTemplate(id, [item].map(x => omit(x, 'text')))} /> <label className="template-control--label"> {tempVar} </label> </div> ) })} >>>>>>> // TODO: change Dropdown to a MultiSelectDropdown, `selected` to // the full array, and [item] to all `selected` values when we update // this component to support multiple values return ( <div key={id} className="template-control--dropdown"> <Dropdown items={items} buttonSize="btn-xs" useAutoComplete={true} selected={selectedText || '(No values)'} onChoose={item => onSelectTemplate(id, [item].map(x => omit(x, 'text')))} /> <label className="template-control--label"> {tempVar} </label> </div> ) }) : <div className="template-control--empty"> This dashboard does not have any Template Variables </div>} </div> <button className="btn btn-primary btn-sm template-control--manage" onClick={onOpenTemplateManager} > <span className="icon cog-thick" /> Manage </button>
<<<<<<< this.filter.setDataOrigin(this._dataOrigin); // Retrigger an event when the changes this.filter.bind('change', this._onFilterChanged, this); ======= >>>>>>> this.filter.setDataOrigin(this._dataOrigin);
<<<<<<< <h2 className="hosts-graph-heading">{cell.name}</h2> <div className="hosts-graph graph-container"> <RefreshingLineGraph queries={qs} autoRefresh={autoRefreshMs} showSingleStat={cell.type === "line-plus-single-stat"} displayOptions={displayOptions} /> ======= <h2 className="dash-graph--heading">{cell.name || `Graph`}</h2> <div className="dash-graph--container"> <RefreshingLineGraph queries={qs} autoRefresh={autoRefreshMs} showSingleStat={cell.type === "line-plus-single-stat"} /> >>>>>>> <h2 className="dash-graph--heading">{cell.name || `Graph`}</h2> <div className="dash-graph--container"> <RefreshingLineGraph queries={qs} autoRefresh={autoRefreshMs} showSingleStat={cell.type === "line-plus-single-stat"} displayOptions={displayOptions} />
<<<<<<< calculateTimeColumnWidth, ======= VERTICAL_TIME_AXIS_DEFAULT, >>>>>>> VERTICAL_TIME_AXIS_DEFAULT, calculateTimeColumnWidth, <<<<<<< unzippedData: [[]], hoveredColumnIndex: NULL_COLUMN_INDEX, hoveredRowIndex: NULL_ROW_INDEX, sortByColumnIndex: NULL_COLUMN_INDEX, clickToSortFieldIndex: NULL_COLUMN_INDEX, clicktoSortDirection: DEFAULT_SORT, timeColumnWidth: calculateTimeColumnWidth(props.tableOptions.timeFormat), ======= processedData: [[]], hoveredColumnIndex: NULL_ARRAY_INDEX, hoveredRowIndex: NULL_ARRAY_INDEX, sortField: '', sortDirection: DEFAULT_SORT, >>>>>>> timeColumnWidth: calculateTimeColumnWidth(props.tableOptions.timeFormat), processedData: [[]], hoveredColumnIndex: NULL_ARRAY_INDEX, hoveredRowIndex: NULL_ARRAY_INDEX, sortField: '', sortDirection: DEFAULT_SORT, <<<<<<< clickToSortFieldIndex, clicktoSortDirection, sortByColumnIndex, } = this.state const {tableOptions: {sortBy: {internalName}, timeFormat}} = nextProps if (timeFormat !== this.props.tableOptions.timeFormat) { this.setState({ timeColumnWidth: calculateTimeColumnWidth(timeFormat), }) } ======= tableOptions: {sortBy: {internalName}, fieldNames, verticalTimeAxis}, setDataLabels, } = nextProps if (setDataLabels) { setDataLabels(labels) } let direction, sortFieldName >>>>>>> tableOptions: { sortBy: {internalName}, fieldNames, verticalTimeAxis, timeFormat, }, setDataLabels, } = nextProps if (timeFormat !== this.props.tableOptions.timeFormat) { this.setState({ timeColumnWidth: calculateTimeColumnWidth(timeFormat), }) } if (setDataLabels) { setDataLabels(labels) } let direction, sortFieldName <<<<<<< const {bgColor, textColor} = generateThresholdsListHexs({ colors, lastValue: data[rowIndex][columnIndex], cellType: 'table', }) ======= const {bgColor, textColor} = generateThresholdsListHexs(colors, cellData) >>>>>>> const {bgColor, textColor} = generateThresholdsListHexs({ colors, lastValue: cellData, cellType: 'table', })
<<<<<<< ======= _onLocalTimezoneChanged: function () { this._originalData.set('localTimezone', this.get('localTimezone')); }, _updateURLBinding: function () { // We shouldn't listen url change for fetching the data (with filter) because // we have to wait until we know all the data available (without any filter). this.off('change:url'); this.on('change:url', this._onUrlChanged, this); }, >>>>>>> _onLocalTimezoneChanged: function () { this._originalData.set('localTimezone', this.get('localTimezone')); },
<<<<<<< describe("when there're grid URLs", function () { beforeEach(function () { this.cartoDBLayerGroup.set('urls', { ======= it('should return an array with the grid URL templates', function () { this.cartoDBLayerGroup.set('urls', { grids: [ [ 'url1' ], [ 'url2' ] ] }); expect(this.cartoDBLayerGroup.getGridURLTemplatesWithSubdomains(0)).toEqual([ 'url1' ]); expect(this.cartoDBLayerGroup.getGridURLTemplatesWithSubdomains(1)).toEqual([ 'url2' ]); }); it('should append the api_key to urls', function () { this.cartoDBLayerGroup.set({ apiKey: 'THE_API_KEY', urls: { >>>>>>> describe("when there're grid URLs", function () { beforeEach(function () { this.cartoDBLayerGroup.set('urls', { <<<<<<< it('should append the auth_token to urls', function () { this.cartoDBLayerGroup.set({ authToken: 'AUTH_TOKEN' }); expect(this.cartoDBLayerGroup.getGridURLTemplates(0)).toEqual([ 'url1?auth_token=AUTH_TOKEN' ]); expect(this.cartoDBLayerGroup.getGridURLTemplates(1)).toEqual([ 'url2?auth_token=AUTH_TOKEN' ]); }); ======= expect(this.cartoDBLayerGroup.getGridURLTemplatesWithSubdomains(0)).toEqual([ 'url1?auth_token=AUTH_TOKEN' ]); expect(this.cartoDBLayerGroup.getGridURLTemplatesWithSubdomains(1)).toEqual([ 'url2?auth_token=AUTH_TOKEN' ]); >>>>>>> it('should append the auth_token to urls', function () { this.cartoDBLayerGroup.set({ authToken: 'AUTH_TOKEN' }); expect(this.cartoDBLayerGroup.getGridURLTemplatesWithSubdomains(0)).toEqual([ 'url1?auth_token=AUTH_TOKEN' ]); expect(this.cartoDBLayerGroup.getGridURLTemplatesWithSubdomains(1)).toEqual([ 'url2?auth_token=AUTH_TOKEN' ]); });
<<<<<<< const containerStyle = { width: 'calc(100% - 32px)', height: 'calc(100% - 16px)', position: 'absolute', top: '8px', } ======= let prefix let suffix if (axes) { prefix = axes.y.prefix suffix = axes.y.suffix } >>>>>>> const containerStyle = { width: 'calc(100% - 32px)', height: 'calc(100% - 16px)', position: 'absolute', top: '8px', } let prefix let suffix if (axes) { prefix = axes.y.prefix suffix = axes.y.suffix }
<<<<<<< aggregation: model.get('aggregation') || 'minute', offset: model.get('offset') || 0, bins: model.get('bins'), ======= >>>>>>>
<<<<<<< // keep this for backward compatibility with tiler_* variables if (!dataLayer.options.maps_api_template) { this._setupTilerConfiguration(dataLayer.options.tiler_protocol, dataLayer.options.tiler_domain, dataLayer.options.tiler_port); } else { this.options.maps_api_template = dataLayer.options.maps_api_template; } ======= this.auth_tokens = data.auth_tokens; this._setupTilerConfiguration(dataLayer.options.tiler_protocol, dataLayer.options.tiler_domain, dataLayer.options.tiler_port); >>>>>>> // keep this for backward compatibility with tiler_* variables if (!dataLayer.options.maps_api_template) { this._setupTilerConfiguration(dataLayer.options.tiler_protocol, dataLayer.options.tiler_domain, dataLayer.options.tiler_port); } else { this.options.maps_api_template = dataLayer.options.maps_api_template; } this.auth_tokens = data.auth_tokens;
<<<<<<< /** * Creates a new internal model with the given engine * and the attributes initialized in the constructor. * * @param {Engine} engine - The engine object to be assigned to the internalModel. */ ======= Dataset.prototype = Object.create(Base.prototype); >>>>>>> /** * Creates a new internal model with the given engine * and the attributes initialized in the constructor. * * @param {Engine} engine - The engine object to be assigned to the internalModel. */ Dataset.prototype = Object.create(Base.prototype);
<<<<<<< * * @param {object} source - The source where the layer will fetch the data. * @param {carto.style.CartoCSS} style - A CartoCSS object with the layer styling. * @param {object} [options] * @param {string} [options.id=Autogenerated ID] - Unique layer ID. * @param {Array<string>} [options.featureClickColumns=[]] - Columns that will be available for `featureClick` events. * @param {Array<string>} [options.featureOverColumns=[]] - Columns that will be available for `featureOver` events. ======= * * @param {string} [id] - A unique ID for this layer * @param {carto.source.Base} source - The source where the layer will fetch the data. * @param {carto.style.Base} style - A CartoCSS object with the layer styling. >>>>>>> * * @param {object} source - The source where the layer will fetch the data. * @param {carto.style.CartoCSS} style - A CartoCSS object with the layer styling. * @param {object} [options] * @param {string} [options.id=Autogenerated ID] - Unique layer ID. * @param {Array<string>} [options.featureClickColumns=[]] - Columns that will be available for `featureClick` events. * @param {Array<string>} [options.featureOverColumns=[]] - Columns that will be available for `featureOver` events. <<<<<<< * // with options * new carto.layer.Layer(citiesSource, citiesStyle, { * id: 'myLayer', * featureClickColumns: [ 'name', 'population' ], * featureOverColumns: [ 'name' ] * }); * ======= * new carto.layer.Layer(citiesSource, citiesStyle); * >>>>>>> * // with options * new carto.layer.Layer(citiesSource, citiesStyle, { * id: 'myLayer', * featureClickColumns: [ 'name', 'population' ], * featureOverColumns: [ 'name' ] * }); * <<<<<<< ======= * @extends carto.layer.Base >>>>>>> <<<<<<< _.extend(Layer.prototype, Backbone.Events); /** * Set a new style for this layer. * * @param {carto.style.CartoCSS} New style * @return {Promise} A `Promise` that will be resolved when the new style has been applied. * * @api */ Layer.prototype.setStyle = function (style) { ======= Layer.prototype = Object.create(Base.prototype); Layer.prototype.setStyle = function (style, opts) { opts = opts || {}; >>>>>>> Layer.prototype = Object.create(Base.prototype); /** * Set a new style for this layer. * * @param {carto.style.CartoCSS} New style * @return {Promise} A `Promise` that will be resolved when the new style has been applied. * * @api */ Layer.prototype.setStyle = function (style, opts) { opts = opts || {}; <<<<<<< this._internalModel = this._createInternalModel(engine); }; Layer.prototype._createInternalModel = function (engine) { return new CartoDBLayer({ id: this.id, source: this._source.$getInternalModel(), cartocss: this._style.toCartoCSS(), visible: this._visible, infowindow: getInteractivityFields(this._featureClickColumns), tooltip: getInteractivityFields(this._featureOverColumns) }, { engine: engine }); ======= if (!this._internalModel) { this._internalModel = new CartoDBLayer({ id: this._id, source: this._source.$getInternalModel(), cartocss: this._style.toCartoCSS(), visible: this._visible }, { engine: engine }); } >>>>>>> this._internalModel = this._createInternalModel(engine); }; Layer.prototype._createInternalModel = function (engine) { return new CartoDBLayer({ id: this.id, source: this._source.$getInternalModel(), cartocss: this._style.toCartoCSS(), visible: this._visible, infowindow: getInteractivityFields(this._featureClickColumns), tooltip: getInteractivityFields(this._featureOverColumns) }, { engine: engine }); if (!this._internalModel) { this._internalModel = new CartoDBLayer({ id: this._id, source: this._source.$getInternalModel(), cartocss: this._style.toCartoCSS(), visible: this._visible }, { engine: engine }); }
<<<<<<< var CartoDBLayerGroupNamed = require('cdb/geo/map/cartodb-layer-group-named'); var CartoDBLayerGroupAnonymous = require('cdb/geo/map/cartodb-layer-group-anonymous'); ======= var TimeWidgetView = require('cdb/geo/ui/widgets/time/view'); var Model = require('cdb/core/model'); >>>>>>> var CartoDBLayerGroupNamed = require('cdb/geo/map/cartodb-layer-group-named'); var CartoDBLayerGroupAnonymous = require('cdb/geo/map/cartodb-layer-group-anonymous'); var TimeWidgetView = require('cdb/geo/ui/widgets/time/view'); var Model = require('cdb/core/model');
<<<<<<< var data = this.dataModel.getData(); ======= _.bindAll(this, '_onWindowResize'); $(window).bind('resize', this._onWindowResize); var data = this.model.getData(); >>>>>>> var data = this.model.getData(); <<<<<<< height: this.defaults.chartHeight, data: this.dataModel.getData() ======= width: this.canvasWidth, height: this.canvasHeight, data: this.model.getData() >>>>>>> height: this.defaults.chartHeight, data: this.model.getData() <<<<<<< showOnWidthChange: false, data: this.dataModel.getData() ======= data: this.model.getData() >>>>>>> showOnWidthChange: false, data: this.model.getData()
<<<<<<< _.extend(Base.prototype, Backbone.Events); ======= /** * */ Base.prototype.validateSource = function () { }; >>>>>>> _.extend(Base.prototype, Backbone.Events); /** * */ Base.prototype.validateSource = function () { };
<<<<<<< // this var stores views information for each model this.layers = {}; this.bind('clean', this._removeLayers, this); ======= // this var stores views information for each model this.layers = {}; >>>>>>> // this var stores views information for each model this.layers = {}; this.bind('clean', this._removeLayers, this); <<<<<<< }, _removeLayers: function() { for(var layer in this.layers) { this.layers[layer].remove(); } this.layers = {} ======= }, /** * set model property but unbind changes first in order to not create an infinite loop */ _setModelProperty: function(prop) { this._unbindModel(); this.map.set(prop); this._bindModel(); }, /** bind model properties */ _bindModel: function() { this.map.bind('change:zoom', this._setZoom, this); this.map.bind('change:center', this._setCenter, this); }, /** unbind model properties */ _unbindModel: function() { this.map.unbind('change:zoom', this._setZoom, this); this.map.unbind('change:center', this._setCenter, this); }, _addLayers: function() { var self = this; this.map.layers.each(function(lyr) { self._addLayer(lyr); }); }, _removeLayer: function(layer) { this.layers[layer.cid].remove(); delete this.layers[layer.cid]; }, getLayerByCid: function(cid) { var l = this.layers[cid]; if(!l) { cdb.log.error("layer with cid " + cid + " can't be get"); } return l; }, _setZoom: function(model, z) { throw "to be implemented"; }, _setCenter: function(model, center) { throw "to be implemented"; }, _addLayer: function(layer, layers, opts) { throw "to be implemented"; >>>>>>> }, _removeLayers: function() { for(var layer in this.layers) { this.layers[layer].remove(); } this.layers = {} }, /** * set model property but unbind changes first in order to not create an infinite loop */ _setModelProperty: function(prop) { this._unbindModel(); this.map.set(prop); this._bindModel(); }, /** bind model properties */ _bindModel: function() { this.map.bind('change:zoom', this._setZoom, this); this.map.bind('change:center', this._setCenter, this); }, /** unbind model properties */ _unbindModel: function() { this.map.unbind('change:zoom', this._setZoom, this); this.map.unbind('change:center', this._setCenter, this); }, _addLayers: function() { var self = this; this.map.layers.each(function(lyr) { self._addLayer(lyr); }); }, _removeLayer: function(layer) { this.layers[layer.cid].remove(); delete this.layers[layer.cid]; }, getLayerByCid: function(cid) { var l = this.layers[cid]; if(!l) { cdb.log.error("layer with cid " + cid + " can't be get"); } return l; }, _setZoom: function(model, z) { throw "to be implemented"; }, _setCenter: function(model, center) { throw "to be implemented"; }, _addLayer: function(layer, layers, opts) { throw "to be implemented";
<<<<<<< hoverTime: NULL_HOVER_TIME, queryASTs: [], ======= >>>>>>> queryASTs: [], <<<<<<< handleQueryAST = queryASTs => { this.setState({queryASTs}) } handleSetHoverTime = hoverTime => { this.setState({hoverTime}) } ======= >>>>>>> handleQueryAST = queryASTs => { this.setState({queryASTs}) } <<<<<<< const {zoomedTimeRange, hoverTime, queryASTs} = this.state ======= const {zoomedTimeRange} = this.state >>>>>>> const {zoomedTimeRange, queryASTs} = this.state
<<<<<<< setResolution: func, ======= cellHeight: number, >>>>>>> setResolution: func, cellHeight: number,
<<<<<<< var LeafletLayer = require('../../../../src/api/v4/leaflet-layer'); var Engine = require('../../../../src/engine'); var Events = require('../../../../src/api/v4/events'); ======= var LeafletLayer = require('../../../../src/api/v4/native/leaflet-layer'); var GoogleMapsMapType = require('../../../../src/api/v4/native/google-maps-map-type'); >>>>>>> var LeafletLayer = require('../../../../src/api/v4/native/leaflet-layer'); var GoogleMapsMapType = require('../../../../src/api/v4/native/google-maps-map-type'); var Engine = require('../../../../src/engine'); var Events = require('../../../../src/api/v4/events');
<<<<<<< it("should extract the cdn_url from the vizjson", function(done) { var vizjson = "http://documentation.cartodb.com/api/v2/viz/e7b04b62-b901-11e4-b0d7-0e018d66dc29/viz.json"; var image = cartodb.Image(vizjson); image.getUrl(function(err, url) { expect(image.options.cdn_url.http).toEqual("api.cartocdn.com"); expect(image.options.cdn_url.https).toEqual("cartocdn.global.ssl.fastly.net"); done(); }); }); ======= it("shouldn't use hidden layers to generate the image", function(done) { var vizjson = "http://documentation.cartodb.com/api/v2/viz/42e98b9a-bcce-11e4-9d68-0e9d821ea90d/viz.json"; var image = cartodb.Image(vizjson); image.getUrl(function(err, url) { expect(image.options.layers.layers.length).toEqual(2); done(); }); }); >>>>>>> it("shouldn't use hidden layers to generate the image", function(done) { var vizjson = "http://documentation.cartodb.com/api/v2/viz/42e98b9a-bcce-11e4-9d68-0e9d821ea90d/viz.json"; var image = cartodb.Image(vizjson); image.getUrl(function(err, url) { expect(image.options.layers.layers.length).toEqual(2); done(); }); }); it("should extract the cdn_url from the vizjson", function(done) { var vizjson = "http://documentation.cartodb.com/api/v2/viz/e7b04b62-b901-11e4-b0d7-0e018d66dc29/viz.json"; var image = cartodb.Image(vizjson); image.getUrl(function(err, url) { expect(image.options.cdn_url.http).toEqual("api.cartocdn.com"); expect(image.options.cdn_url.https).toEqual("cartocdn.global.ssl.fastly.net"); done(); }); });
<<<<<<< require('../../../src/vis/overlays'); // Overlay.register calls ======= var OverlaysFactory = require('../../../src/vis/overlays-factory'); require('../../../src/vis/layers'); // Layers.register calls >>>>>>> var OverlaysFactory = require('../../../src/vis/overlays-factory');
<<<<<<< WidgetModel.prototype.initialize.call(this, attrs, opts); // Retrigger an event when the changes this.filter.bind('change', this._onFilterChanged, this); ======= WidgetModel.prototype.initialize.call(this); this._dataOrigin = new Backbone.Collection(this.get('data')); >>>>>>> this._dataOrigin = new Backbone.Collection(this.get('data')); // Retrigger an event when the changes this.filter.bind('change', this._onFilterChanged, this); WidgetModel.prototype.initialize.call(this, attrs, opts);
<<<<<<< var dataProvider = this.layer.getDataProvider(); if (dataProvider) { dataProvider.bind('featuresChanged', this._onDataProviderChanged, this); } else { this.listenToOnce(this, 'change:url', function () { this._fetch(this._onChangeBinds.bind(this)); }); } ======= this.listenToOnce(this, 'change:url', function () { this.fetch({ success: this._onChangeBinds.bind(this) }); }); // Retrigger an event when the filter changes >>>>>>> var dataProvider = this.layer.getDataProvider(); if (dataProvider) { dataProvider.bind('featuresChanged', this._onDataProviderChanged, this); } else { this.listenToOnce(this, 'change:url', function () { this.fetch({ success: this._onChangeBinds.bind(this) }); }); } <<<<<<< _fetch: function (callback) { var self = this; this.fetch({ success: callback, error: function () { self.trigger('error'); } }); }, fetch: function (opts) { var dataProvider = this.layer.getDataProvider(); if (dataProvider) { var data = dataProvider.generateDataForDataview(this, dataProvider.getData()); this.set(this.parse(data)); this.trigger('sync'); } else { this.trigger('loading', this); return Model.prototype.fetch.call(this, opts); } ======= refresh: function () { this.fetch(); >>>>>>> refresh: function () { this.fetch(); <<<<<<< ======= fetch: function (opts) { opts = opts || {}; this.trigger('loading', this); return Model.prototype.fetch.call(this, _.extend(opts, { error: function () { this.trigger('error'); }.bind(this) })); }, >>>>>>> fetch: function (opts) { opts = opts || {}; var dataProvider = this.layer.getDataProvider(); if (dataProvider) { var data = dataProvider.generateDataForDataview(this, dataProvider.getData()); this.set(this.parse(data)); this.trigger('sync'); } else { this.trigger('loading', this); return Model.prototype.fetch.call(this, _.extend(opts, { error: function () { this.trigger('error'); }.bind(this) })); } },
<<<<<<< var dataProvider = this.layer.getDataProvider(); if (dataProvider) { dataProvider.bind('featuresChanged', this._onDataProviderChanged, this); } else { this.listenToOnce(this, 'change:url', function () { this.fetch({ success: this._onChangeBinds.bind(this) }); ======= this.listenTo(this.layer, 'change:visible', this._onLayerVisibilityChanged); this.listenToOnce(this, 'change:url', function () { this.fetch({ success: this._onChangeBinds.bind(this) >>>>>>> var dataProvider = this.layer.getDataProvider(); if (dataProvider) { dataProvider.bind('featuresChanged', this._onDataProviderChanged, this); } else { this.listenTo(this.layer, 'change:visible', this._onLayerVisibilityChanged); this.listenToOnce(this, 'change:url', function () { this.fetch({ success: this._onChangeBinds.bind(this) }); <<<<<<< ======= /** * Enable/disable the dataview depending on the layer visibility. * @private * @param {LayerModel} model the layer model which visible property has changed. * @param {Boolean} value New value for visible. * @returns {void} */ _onLayerVisibilityChanged: function (model, value) { this.set({enabled: value}); }, _onMapBoundsChanged: function () { this._updateBoundingBox(); }, _updateBoundingBox: function () { var boundingBoxFilter = new WindshaftFiltersBoundingBoxFilter(this._map.getViewBounds()); this.set('boundingBox', boundingBoxFilter.toString()); }, >>>>>>> /** * Enable/disable the dataview depending on the layer visibility. * @private * @param {LayerModel} model the layer model which visible property has changed. * @param {Boolean} value New value for visible. * @returns {void} */ _onLayerVisibilityChanged: function (model, value) { this.set({enabled: value}); }, _onMapBoundsChanged: function () { this._updateBoundingBox(); }, _updateBoundingBox: function () { var boundingBoxFilter = new WindshaftFiltersBoundingBoxFilter(this._map.getViewBounds()); this.set('boundingBox', boundingBoxFilter.toString()); },
<<<<<<< if (torque) { this.torqueLayer = torque; // send step events from torque layer this.torqueLayer.bind('change:time', function(s) { this.trigger('change:step', this.torqueLayer, this.torqueLayer.getStep()); }, this); if (!this.isMobileEnabled && this.torqueLayer) { this.addTimeSlider(this.torqueLayer); } } }, // sets the animation step if there is an animation // returns true if succed setAnimationStep: function(s, opt) { if (this.torqueLayer) { this.torqueLayer.setStep(s, opt); return true; } return false; }, _createSlides: function(slides) { function BackboneActions(model) { var actions = { set: function() { var args = arguments; return O.Action({ enter: function() { model.set.apply(model, args); } }); }, reset: function() { var args = arguments; return O.Action({ enter: function() { model.reset.apply(model, args); } }); } }; return actions; } function SetStepAction(vis, step) { return O.Action(function() { vis.setAnimationStep(step); }); } function AnimationTrigger(vis, step) { var t = O.Trigger(); vis.on('change:step', function (layer, currentStep) { if (currentStep === step) { t.trigger(); } }); return t; } function PrevTrigger(seq, step) { var t = O.Trigger(); var c = PrevTrigger._callbacks; if (!c) { c = PrevTrigger._callbacks = [] O.Keys().left().then(function() { for (var i = 0; i < c.length; ++i) { if (c[i] === seq.current()) { t.trigger(); return; } } }); } c.push(step); return t; } function NextTrigger(seq, step) { var t = O.Trigger(); var c = NextTrigger._callbacks; if (!c) { c = NextTrigger._callbacks = [] O.Keys().right().then(function() { for (var i = 0; i < c.length; ++i) { if (c[i] === seq.current()) { t.trigger(); return; } } }); } c.push(step); return t; } function WaitAction(seq, ms) { return O.Step(O.Sleep(ms), O.Action(function() { seq.next(); })); } var self = this; var seq = this.sequence = O.Sequential(); this.slides = O.Story(); // transition - debug, remove //O.Keys().left().then(seq.prev, seq); //O.Keys().right().then(seq.next, seq); ======= >>>>>>> <<<<<<< // if there's no header overlay, we need to explicitly create the slide controller if ((options["slides_controller"] || options["slides_controller"] === undefined) && !this.isMobileEnabled && !_.find(overlays, function(o) { return o.type === 'header' && o.options.display; })) { this._addSlideController(vis_data); } ======= >>>>>>> overlays = overlays.toJSON(); // Sort the overlays by its internal order overlays = _.sortBy(overlays, function(overlay) { return overlay.order === null ? Number.MAX_VALUE: overlay.order; }); // clean current overlays while (this.overlays.length !== 0) { this.overlays.pop().clean(); } this._createOverlays(overlays, data, options); }, _setupSublayers: function(layers, options) { options.sublayer_options = []; _.each(layers.slice(1), function(lyr) { if (lyr.type === 'layergroup') { _.each(lyr.options.layer_definition.layers, function(l) { options.sublayer_options.push({ visible: ( l.visible !== undefined ? l.visible : true ) }) }); } else if (lyr.type === 'namedmap') { _.each(lyr.options.named_map.layers, function(l) { options.sublayer_options.push({ visible: ( l.visible !== undefined ? l.visible : true ) }) }); } else if (lyr.type === 'torque') { options.sublayer_options.push({ visible: ( lyr.options.visible !== undefined ? lyr.options.visible : true ) }) } }); }, load: function(data, options) { var self = this; if (typeof(data) === 'string') { var url = data; Loader.get(url, function(data) { if (data) { self.load(data, options); } else { self.throwError('error fetching viz.json file'); } }); return this; } // load modules needed for layers var layers = data.layers; if (!this.checkModules(layers)) { if (this.moduleChecked) { self.throwError("modules couldn't be loaded"); return this; } this.moduleChecked = true; this.loadModules(layers, function() { self.load(data, options); }); return this; } // TODO: This should be part of a model if (window && window.location.protocol && window.location.protocol === 'https:') { this.https = true; } if (data.https) { this.https = data.https; } options = options || {}; this._applyOptions(data, options); // to know if the logo is enabled search in the overlays and see if logo overlay is included and is shown var has_logo_overlay = !!_.find(data.overlays, function(o) { return o.type === 'logo' && o.options.display; }); this.cartodb_logo = (options.cartodb_logo !== undefined) ? options.cartodb_logo: has_logo_overlay; if (this.mobile) { this.cartodb_logo = false; } else if (!has_logo_overlay && options.cartodb_logo === undefined) { this.cartodb_logo = true; } var scrollwheel = (options.scrollwheel === undefined) ? data.scrollwheel : options.scrollwheel; // Do not allow pan map if zoom overlay and scrollwheel are disabled unless // mobile view is enabled var isMobileDevice = this.isMobileDevice(); // Do not allow pan map if zoom overlay and scrollwheel are disabled // Check if zoom overlay is present. var hasZoomOverlay = _.isObject(_.find(data.overlays, function(overlay) { return overlay.type == "zoom"; })); var allowDragging = isMobileDevice || hasZoomOverlay || scrollwheel; //Force using GMaps ? if ( (this.gmaps_base_type) && (data.map_provider === "leaflet") ) { //Check if base_type is correct var typesAllowed = ['roadmap', 'gray_roadmap', 'dark_roadmap', 'hybrid', 'satellite', 'terrain']; if (_.contains(typesAllowed, this.gmaps_base_type)) { if (data.layers) { data.layers[0].options.type = 'GMapsBase'; data.layers[0].options.base_type = this.gmaps_base_type; data.layers[0].options.name = this.gmaps_base_type; if (this.gmaps_style) { data.layers[0].options.style = typeof this.gmaps_style === 'string' ? JSON.parse(this.gmaps_style): this.gmaps_style; } data.map_provider = 'googlemaps'; data.layers[0].options.attribution = ''; //GMaps has its own attribution } else { log.error('No base map loaded. Using Leaflet.'); } } else { log.error('GMaps base_type "' + this.gmaps_base_type + ' is not supported. Using leaflet.'); } } // Create the instance of the cdb.geo.Map model var mapConfig = { title: data.title, description: data.description, maxZoom: data.maxZoom || this.DEFAULT_MAX_ZOOM, minZoom: data.minZoom || this.DEFAULT_MIN_ZOOM, legends: data.legends, scrollwheel: scrollwheel, drag: allowDragging, provider: data.map_provider }; // if the boundaries are defined, we add them to the map if (data.bounding_box_sw && data.bounding_box_ne) { mapConfig.bounding_box_sw = data.bounding_box_sw; mapConfig.bounding_box_ne = data.bounding_box_ne; } if (data.bounds) { mapConfig.view_bounds_sw = data.bounds[0]; mapConfig.view_bounds_ne = data.bounds[1]; } else { var center = data.center; if (typeof(center) === "string") { center = $.parseJSON(center); } mapConfig.center = center || [0, 0]; mapConfig.zoom = data.zoom === undefined ? 4: data.zoom; } var map = new Map(mapConfig); this.map = map; this.overlayModels = new Backbone.Collection(); // If a CartoDB embed map is hidden by default, its // height is 0 and it will need to recalculate its size // and re-center again. // We will wait until it is resized and then apply // the center provided in the parameters and the // correct size. var map_h = this.$el.outerHeight(); if (map_h === 0) { this.mapConfig = mapConfig; $(window).bind('resize', this._onResize); } var div = $('<div>').css({ position: 'relative', width: '100%', height: '100%' }); this.container = div; // Another div to prevent leaflet grabbing the div var div_hack = $('<div>') .addClass("cartodb-map-wrapper") .css({ position: "absolute", top: 0, left: 0, right: 0, bottom: 0, width: '100%' }); div.append(div_hack); this.$el.append(div); // Create the map var mapView = new MapView.create(div_hack, map); this.mapView = mapView; if (options.legends || (options.legends === undefined && this.map.get("legends") !== false)) { map.layers.bind('reset', this.addLegends, this); } this.overlayModels.bind('reset', function(overlays) { this._addOverlays(overlays, data, options); this._addMobile(data, options); }, this); this.mapView.bind('newLayerView', this._addLoading, this); if (this.infowindow) { this.mapView.bind('newLayerView', this.addInfowindow, this); } if (this.tooltip) { this.mapView.bind('newLayerView', this.addTooltip, this); } var cartoDBLayers; var cartoDBLayerGroup; var layers = []; _.each(data.layers, function(layerData) { if (layerData.type === 'layergroup' || layerData.type === 'namedmap') { var layersData; var layerGroupClass; if (layerData.type === 'layergroup') { layersData = layerData.options.layer_definition.layers; layerGroupClass = CartoDBLayerGroupAnonymous; } else { layersData = layerData.options.named_map.layers; layerGroupClass = CartoDBLayerGroupNamed; } cartoDBLayers = _.map(layersData, function(layerData) { var cartoDBLayer = Layers.create("cartodb", self, layerData); return cartoDBLayer; }); cartoDBLayerGroup = new layerGroupClass({}, { layers: cartoDBLayers }); layers.push(cartoDBLayerGroup); } else { // Treat differently since this kind of layer is rendered client-side (and not through the tiler) var layer = Layers.create(layerData.type, self, layerData); layers.push(layer); } }); this.map.layers.reset(layers); this.overlayModels.reset(data.overlays); // if there are no sublayer_options fill it if (!options.sublayer_options) { this._setupSublayers(data.layers, options); } this._setLayerOptions(options); _.defer(function() { self.trigger('done', self, map.layers); }); return this; }, _createOverlays: function(overlays, vis_data, options) {
<<<<<<< var AnalysisFactory = require('../analysis/analysis-factory'); ======= var VizJSON = require('./vizjson'); var util = require('cdb.core.util'); >>>>>>> var AnalysisFactory = require('../analysis/analysis-factory'); var VizJSON = require('./vizjson'); var util = require('cdb.core.util'); <<<<<<< if (data.bounds) { this.mapConfig.view_bounds_sw = data.bounds[0]; this.mapConfig.view_bounds_ne = data.bounds[1]; } else { var center = data.center; if (typeof (center) === 'string') { center = $.parseJSON(center); } this.mapConfig.center = center || [0, 0]; this.mapConfig.zoom = data.zoom === undefined ? 4 : data.zoom; } this.map = new Map(this.mapConfig, { windshaftMap: this._windshaftMap, ======= this.map = new Map(mapConfig, { windshaftMap: windshaftMap, >>>>>>> this.map = new Map(mapConfig, { windshaftMap: this._windshaftMap,
<<<<<<< // there is a race condition in leaflet. If size is invalidated // and at the same time the center is set the final center is displaced // so set pan to false so the map is not moved and then force the map // to be at the place it should be this._leafletMap.invalidateSize({ pan: false }); // , animate: false }); this._leafletMap.setView(this.map.get('center'), this.map.get('zoom') || 0, { animate: false }); this.map.setMapViewSize(this.getSize()); ======= var center = this.map.get('center'); var zoom = this.map.get('zoom'); this._leafletMap.invalidateSize({ pan: false, animate: false }); this._leafletMap.setView(center, zoom, { pan: false, animate: false }); >>>>>>> var center = this.map.get('center'); var zoom = this.map.get('zoom'); this._leafletMap.invalidateSize({ pan: false, animate: false }); this._leafletMap.setView(center, zoom, { pan: false, animate: false }); this.map.setMapViewSize(this.getSize());
<<<<<<< function _setVibrancy(win, op = null) { if (op && supportedType.indexOf(op) === -1 && op[0] !== '#') op = 'appearance-based'; if (op === 'appearance-based') { if (nativeTheme.shouldUseDarkColors) op = 'dark'; else op = 'light'; } let redValue, greenValue, blueValue, alphaValue; if (op === 'light') op = _lightThemeColor; else if (op === 'dark') op = _darkThemeColor; if (op) redValue = parseInt(op.substring(1, 3), 16), greenValue = parseInt(op.substring(3, 5), 16), blueValue = parseInt(op.substring(5, 7), 16), alphaValue = parseInt(op.substring(7, 9), 16); if (op) { wSetVibrancy(getHwnd(win), isRS4OrGreater() ? 1 : 0, redValue, greenValue, blueValue, alphaValue); win._vibrancyActivated = true; setTimeout(() => { if (win._vibrancyActivated) win.setBackgroundColor('#00000000'); }, 50); } else { win._ignoreBlurFocusEvent = 2; win._vibrancyActivated = false; let bOp = win._vibrancyOp; if (bOp === 'light') bOp = _lightThemeColor; else if (bOp === 'dark') bOp = _darkThemeColor; win.setBackgroundColor('#99' + bOp.substring(1, 7)); setTimeout(() => { if (!win._vibrancyActivated) wDisableVibrancy(getHwnd(win)); }, 10); } } ======= function sleep(time) { return new Promise(resolve => setTimeout(resolve, time)); } function areBoundsEqual(left, right) { return left.height === right.height && left.width === right.width && left.x === right.x && left.y === right.y; } const billion = 1000 * 1000 * 1000; function hrtimeDeltaForFrequency(freq) { return BigInt(Math.ceil(billion / freq)); } >>>>>>> function _setVibrancy(win, op = null) { if (op && supportedType.indexOf(op) === -1 && op[0] !== '#') op = 'appearance-based'; if (op === 'appearance-based') { if (nativeTheme.shouldUseDarkColors) op = 'dark'; else op = 'light'; } let redValue, greenValue, blueValue, alphaValue; if (op === 'light') op = _lightThemeColor; else if (op === 'dark') op = _darkThemeColor; if (op) redValue = parseInt(op.substring(1, 3), 16), greenValue = parseInt(op.substring(3, 5), 16), blueValue = parseInt(op.substring(5, 7), 16), alphaValue = parseInt(op.substring(7, 9), 16); if (op) { wSetVibrancy(getHwnd(win), isRS4OrGreater() ? 1 : 0, redValue, greenValue, blueValue, alphaValue); win._vibrancyActivated = true; setTimeout(() => { if (win._vibrancyActivated) win.setBackgroundColor('#00000000'); }, 50); } else { win._ignoreBlurFocusEvent = 2; win._vibrancyActivated = false; let bOp = win._vibrancyOp; if (bOp === 'light') bOp = _lightThemeColor; else if (bOp === 'dark') bOp = _darkThemeColor; win.setBackgroundColor('#99' + bOp.substring(1, 7)); setTimeout(() => { if (!win._vibrancyActivated) wDisableVibrancy(getHwnd(win)); }, 10); } } function sleep(time) { return new Promise(resolve => setTimeout(resolve, time)); } function areBoundsEqual(left, right) { return left.height === right.height && left.width === right.width && left.x === right.x && left.y === right.y; } const billion = 1000 * 1000 * 1000; function hrtimeDeltaForFrequency(freq) { return BigInt(Math.ceil(billion / freq)); }
<<<<<<< const roundId = 3, poorJuror = juror100 ======= const roundId = DEFAULTS.maxRegularAppealRounds.toNumber(), poorJuror = juror500 >>>>>>> const roundId = DEFAULTS.maxRegularAppealRounds.toNumber(), poorJuror = juror100
<<<<<<< // advance one term to avoid drafting all the batches in the same term await courtHelper.passRealTerms(1) const receipt = await court.draft(disputeId, { from: drafter }) ======= const receipt = await court.draft(disputeId, jurorsPerBatch, { from: drafter }) >>>>>>> const receipt = await court.draft(disputeId, { from: drafter }) <<<<<<< // advance one term to avoid drafting all the batches in the same term await courtHelper.passRealTerms(1) lastReceipt = await court.draft(disputeId, { from: drafter }) ======= lastReceipt = await court.draft(disputeId, jurorsPerBatch, { from: drafter }) // advance one term to avoid drafting all the batches in the same term if (batch + 1 < batches) await courtHelper.passRealTerms(1) >>>>>>> lastReceipt = await court.draft(disputeId, { from: drafter }) // advance one term to avoid drafting all the batches in the same term if (batch + 1 < batches) await courtHelper.passRealTerms(1) <<<<<<< // advance one term to avoid drafting all the batches in the same term await courtHelper.passRealTerms(1) await court.draft(disputeId, { from: drafter }) lastTerm = await court.getLastEnsuredTermId() ======= await court.draft(disputeId, jurorsPerBatch, { from: drafter }) lastTerm = await courtHelper.controller.getLastEnsuredTermId() // advance one term to avoid drafting all the batches in the same term if (batch + 1 < batches) await courtHelper.passRealTerms(1) >>>>>>> await court.draft(disputeId, { from: drafter }) lastTerm = await court.getLastEnsuredTermId() // advance one term to avoid drafting all the batches in the same term if (batch + 1 < batches) await courtHelper.passRealTerms(1) <<<<<<< // advance one term to avoid drafting all the batches in the same term await courtHelper.passRealTerms(1) const receipt = await court.draft(disputeId, { from: drafter }) ======= const receipt = await court.draft(disputeId, jurorsPerBatch, { from: drafter }) >>>>>>> const receipt = await court.draft(disputeId, { from: drafter }) <<<<<<< // advance one term to avoid drafting all the batches in the same term await courtHelper.passRealTerms(1) await court.draft(disputeId, { from: drafter }) ======= await court.draft(disputeId, jurorsPerBatch, { from: drafter }) >>>>>>> await court.draft(disputeId, { from: drafter }) <<<<<<< await assertRevert(court.draft(disputeId, { from: drafter }), 'CT_TERM_RANDOMNESS_NOT_YET') ======= await assertRevert(court.draft(disputeId, firstRoundJurorsNumber, { from: drafter }), 'CLK_TERM_RANDOMNESS_NOT_YET') >>>>>>> await assertRevert(court.draft(disputeId, { from: drafter }), 'CLK_TERM_RANDOMNESS_NOT_YET') <<<<<<< // no need to advance the block here because setting the maxJurorsPerDraftBatch will do the job ======= beforeEach('move one block after the draft term block number', async () => { await advanceBlocksAfterDraftBlockNumber(1) }) >>>>>>> // no need to move one block since the `beforeEach` block will hit the next block <<<<<<< beforeEach('move 255 blocks after the draft term', async () => { // advance the block 1 less here because setting the maxJurorsPerDraftBatch will do the missing one await advanceBlocks(254) ======= beforeEach('move 15 blocks after the draft term block number', async () => { await advanceBlocksAfterDraftBlockNumber(15) >>>>>>> beforeEach('move 15 blocks after the draft term block number', async () => { await advanceBlocksAfterDraftBlockNumber(15) <<<<<<< beforeEach('move 256 blocks after the draft term', async () => { // advance the block 1 less here because setting the maxJurorsPerDraftBatch will do the missing one await advanceBlocks(255) ======= beforeEach('move 256 blocks after the draft term block number', async () => { // moving 255 blocks instead of 256 since the draft will hit the next block await advanceBlocksAfterDraftBlockNumber(255) >>>>>>> beforeEach('move 256 blocks after the draft term block number', async () => { // moving 255 blocks instead of 256 since the `beforeEach` block will hit the next block await advanceBlocksAfterDraftBlockNumber(255) <<<<<<< await assertRevert(court.draft(disputeId, { from: drafter }), 'CT_TERM_RANDOMNESS_NOT_AVAILABLE') ======= await assertRevert(court.draft(disputeId, firstRoundJurorsNumber, { from: drafter }), 'CLK_TERM_RANDOMNESS_UNAVAILABLE') >>>>>>> await assertRevert(court.draft(disputeId, { from: drafter }), 'CLK_TERM_RANDOMNESS_UNAVAILABLE') <<<<<<< await assertRevert(court.draft(disputeId, { from: drafter }), 'CT_ROUND_NOT_DRAFT_TERM') ======= await assertRevert(court.draft(disputeId, firstRoundJurorsNumber, { from: drafter }), 'CLK_TERM_DOES_NOT_EXIST') >>>>>>> await assertRevert(court.draft(disputeId, { from: drafter }), 'CLK_TERM_DOES_NOT_EXIST')
<<<<<<< const { assertAmountOfEvents, assertEvent } = require('../helpers/assertEvent') const { OUTCOMES, getVoteId, oppositeOutcome } = require('../helpers/crvoting') ======= const { assertAmountOfEvents, assertEvent } = require('@aragon/os/test/helpers/assertEvent')(web3) const { getVoteId, oppositeOutcome, OUTCOMES } = require('../helpers/crvoting')(web3) >>>>>>> const { assertAmountOfEvents, assertEvent } = require('../helpers/assertEvent') const { getVoteId, oppositeOutcome, OUTCOMES } = require('../helpers/crvoting') <<<<<<< // for final rounds all voter's tokens are collected before hand if (roundId >= courtHelper.maxRegularAppealRounds.toNumber()) { ======= // for final rounds all voter's tokens are collected before hand, then, add the balances of the winning jurors as well if (roundId >= courtHelper.maxRegularAppealRounds) { >>>>>>> // for final rounds all voter's tokens are collected before hand, then, add the balances of the winning jurors as well if (roundId >= courtHelper.maxRegularAppealRounds.toNumber()) { <<<<<<< let expectedDraftTermId = draftTermId for (let round = 0; round < roundId; round++) { const { commitTerms, revealTerms, appealTerms, appealConfirmTerms } = courtHelper expectedDraftTermId = bn(expectedDraftTermId).add(commitTerms).add(revealTerms).add(appealTerms).add(appealConfirmTerms) } let expectedJurorsNumber if (roundId < courtHelper.maxRegularAppealRounds) { expectedJurorsNumber = jurorsNumber for (let round = 0; round < roundId; round++) { expectedJurorsNumber = courtHelper.getNextRoundJurorsNumberFor(expectedJurorsNumber) } } else { const totalActiveBalance = await courtHelper.jurorsRegistry.totalActiveBalanceAt(expectedDraftTermId) expectedJurorsNumber = totalActiveBalance.mul(bn(1000)).div(courtHelper.jurorsMinActiveBalance) } const { draftTerm, delayedTerms, roundJurorsNumber, selectedJurors, triggeredBy, settledPenalties, collectedTokens, coherentJurors } = await courtHelper.getRound(disputeId, roundId) ======= const { settledPenalties, collectedTokens, coherentJurors } = await courtHelper.getRound(disputeId, roundId) >>>>>>> const { settledPenalties, collectedTokens, coherentJurors } = await courtHelper.getRound(disputeId, roundId) <<<<<<< assert.equal(delayedTerms.toString(), 0, 'current round delay term does not match') assert.equal(draftTerm.toString(), expectedDraftTermId.toString(), 'current round draft term does not match') assert.equal(roundJurorsNumber.toString(), expectedJurorsNumber.toString(), 'current round jurors number does not match') assert.equal(selectedJurors.toString(), roundId < courtHelper.maxRegularAppealRounds.toNumber() ? expectedJurorsNumber.toString() : 0, 'current round selected jurors number does not match') assert.equal(triggeredBy, roundId === 0 ? disputer : appealTaker, 'current round trigger does not match') ======= >>>>>>> <<<<<<< assert.equal(previousBalance.add(expectedAppealDeposit).toString(), currentBalance.toString(), 'appealer balances do not match') ======= assert.equal(previousBalance.plus(appealDeposit).toString(), currentBalance.toString(), 'appeal maker balances do not match') >>>>>>> assert.equal(previousBalance.add(appealDeposit).toString(), currentBalance.toString(), 'appeal maker balances do not match') <<<<<<< assert.equal(previousAppealTakerBalance.add(expectedAppealReward).toString(), currentAppealTakerBalance.toString(), 'appealer balances do not match') ======= assert.equal(previousAppealTakerBalance.plus(expectedAppealReward).toString(), currentAppealTakerBalance.toString(), 'appeal maker balances do not match') >>>>>>> assert.equal(previousAppealTakerBalance.add(expectedAppealReward).toString(), currentAppealTakerBalance.toString(), 'appeal maker balances do not match') <<<<<<< const appealDeposit = await courtHelper.getAppealDeposit(disputeId, roundId) const appealConfirmDeposit = await courtHelper.getConfirmAppealDeposit(disputeId, roundId) const appealFees = await courtHelper.getAppealFees(disputeId, roundId) const expectedAppealReward = appealDeposit.add(appealConfirmDeposit).sub(appealFees) ======= const { appealFees, appealDeposit, confirmAppealDeposit } = await courtHelper.getAppealFees(disputeId, roundId) const expectedAppealReward = appealDeposit.plus(confirmAppealDeposit).minus(appealFees) >>>>>>> const { appealFees, appealDeposit, confirmAppealDeposit } = await courtHelper.getAppealFees(disputeId, roundId) const expectedAppealReward = appealDeposit.add(confirmAppealDeposit).sub(appealFees) <<<<<<< assert.equal(previousAppealMakerBalance.add(expectedAppealReward).toString(), currentAppealMakerBalance.toString(), 'appealer balances do not match') ======= assert.equal(previousAppealMakerBalance.plus(expectedAppealReward).toString(), currentAppealMakerBalance.toString(), 'appeal maker balances do not match') >>>>>>> assert.equal(previousAppealMakerBalance.add(expectedAppealReward).toString(), currentAppealMakerBalance.toString(), 'appeal maker balances do not match') <<<<<<< const expectedAppealTakerReward = appealConfirmDeposit.sub(appealFees.div(bn(2))) ======= const expectedAppealTakerReward = confirmAppealDeposit.minus(appealFees.divToInt(2)) >>>>>>> const expectedAppealTakerReward = confirmAppealDeposit.sub(appealFees.div(bn(2)))
<<<<<<< const { receipt, addresses, weights, outputLength, selectedJurors } = await draft({ batchRequestedJurors, roundRequestedJurors }) ======= const receipt = await draft({ batchRequestedJurors, roundRequestedJurors }) const { addresses, weights, outputLength } = getEventAt(receipt, 'Drafted').args >>>>>>> const { receipt, addresses, weights, outputLength } = await draft({ batchRequestedJurors, roundRequestedJurors }) <<<<<<< const { receipt, addresses, weights, outputLength, selectedJurors, expectedJurors } = await draft({ termRandomness, disputeId, selectedJurors: previousSelectedJurors, batchRequestedJurors, roundRequestedJurors }) ======= const receipt = await draft({ termRandomness, disputeId, previousSelectedJurors, batchRequestedJurors, roundRequestedJurors }) const { addresses, weights, outputLength } = getEventAt(receipt, 'Drafted').args >>>>>>> const { receipt, addresses, weights, outputLength, expectedJurors } = await draft({ termRandomness, disputeId, selectedJurors: previousSelectedJurors, batchRequestedJurors, roundRequestedJurors }) <<<<<<< assert.equal(selectedJurors.toString(), previousSelectedJurors + batchRequestedJurors, 'amount of selected jurors does not match') assert.equal(batchRequestedJurors, expectedJurors.reduce((acc, j) => acc + j.weight, 0), 'total weight does not match') ======= >>>>>>> <<<<<<< beforeEach('lock first expected juror', async () => { await lockFirstExpectedJuror(batchRequestedJurors, roundRequestedJurors) }) itReturnsExpectedJurors({ previousSelectedJurors, batchRequestedJurors, roundRequestedJurors }) ======= context('for the first batch', () => { const batchRequestedJurors = 3 const previousSelectedJurors = 0 const expectedWeights = [3] const expectedAddresses = [juror2000] itReturnsExpectedJurors({ previousSelectedJurors, batchRequestedJurors, roundRequestedJurors }, expectedAddresses, expectedWeights) }) context('for the second batch', () => { const batchRequestedJurors = 7 const previousSelectedJurors = 3 const expectedWeights = [2, 4, 1] const expectedAddresses = [juror2000, juror3000, juror3500] itReturnsExpectedJurors({ previousSelectedJurors, batchRequestedJurors, roundRequestedJurors }, expectedAddresses, expectedWeights) }) >>>>>>> beforeEach('lock first expected juror', async () => { await lockFirstExpectedJuror(batchRequestedJurors, roundRequestedJurors) }) context('for the first batch', () => { const batchRequestedJurors = 3 const previousSelectedJurors = 0 itReturnsExpectedJurors({ previousSelectedJurors, batchRequestedJurors, roundRequestedJurors }) }) context('for the second batch', () => { const batchRequestedJurors = 7 const previousSelectedJurors = 3 itReturnsExpectedJurors({ previousSelectedJurors, batchRequestedJurors, roundRequestedJurors }) })
<<<<<<< if (!readTransactionFinished) { SelfTest.finishWithError(errorcb, 'readTransaction did not finish'); return; } return db.transaction(function(tx3) { tx3.executeSql('DELETE FROM TestTable'); return tx3.executeSql('INSERT INTO TestTable (data) VALUES(?)', [123]); }, function(tx3_err) { return SelfTest.finishWithError(errorcb, "DELETE transaction error: " + tx3_err); }, function() { var secondReadTransactionFinished; secondReadTransactionFinished = false; return db.readTransaction(function(tx4) { return tx4.executeSql('SELECT id, data FROM TestTable', [], function(ignored, resutSet3) { if (!resutSet3.rows) { throw newSQLError('Missing resutSet3.rows'); } if (!resutSet3.rows.length) { throw newSQLError('Missing resutSet3.rows.length'); } if (resutSet3.rows.length !== 1) { throw newSQLError("Incorrect resutSet3.rows.length value: " + resutSet3.rows.length + " (expected: 1)"); } if (!resutSet3.rows.item(0).id) { throw newSQLError('Missing resutSet3.rows.item(0).id'); } if (resutSet3.rows.item(0).id === firstid) { throw newSQLError("resutSet3.rows.item(0).id value " + (resutSet3.rows.item(0).id) + " incorrectly matches previous unique key id value value (" + firstid + ")"); } if (!resutSet3.rows.item(0).data) { throw newSQLError('Missing resutSet3.rows.item(0).data'); } if (resutSet3.rows.item(0).data !== 123) { throw newSQLError("Incorrect resutSet3.rows.item(0).data value: " + (resutSet3.rows.item(0).data) + " (expected 123)"); } return secondReadTransactionFinished = true; }); }, function(tx4_err) { return SelfTest.finishWithError(errorcb, "second readTransaction error: " + tx4_err); }, function() { if (!secondReadTransactionFinished) { SelfTest.finishWithError(errorcb, 'second readTransaction did not finish'); return; } return db.close(function() { return SQLiteFactory.deleteDatabase({ name: SelfTest.DBNAME, location: 'default' }, successcb, function(cleanup_err) { if (/Windows /.test(navigator.userAgent) || /IEMobile/.test(navigator.userAgent)) { console.log("IGNORE CLEANUP (DELETE) ERROR: " + (JSON.stringify(cleanup_err)) + " (Windows/WP8)"); successcb(); return; } return SelfTest.finishWithError(errorcb, "Cleanup error: " + cleanup_err); }); }, function(close_err) { if (/Windows /.test(navigator.userAgent) || /IEMobile/.test(navigator.userAgent)) { console.log("IGNORE close ERROR: " + (JSON.stringify(close_err)) + " (Windows/WP8)"); SQLiteFactory.deleteDatabase({ name: SelfTest.DBNAME, location: 'default' }, successcb, successcb); return; } return SelfTest.finishWithError(errorcb, "close error: " + close_err); }); }); ======= db.close(function() { SelfTest.cleanupAndFinish(successcb, errorcb); }, function(close_err) { SelfTest.finishWithError(errorcb, "close error: " + close_err); >>>>>>> if (!readTransactionFinished) { SelfTest.finishWithError(errorcb, 'readTransaction did not finish'); return; } return db.transaction(function(tx3) { tx3.executeSql('DELETE FROM TestTable'); return tx3.executeSql('INSERT INTO TestTable (data) VALUES(?)', [123]); }, function(tx3_err) { return SelfTest.finishWithError(errorcb, "DELETE transaction error: " + tx3_err); }, function() { var secondReadTransactionFinished; secondReadTransactionFinished = false; return db.readTransaction(function(tx4) { return tx4.executeSql('SELECT id, data FROM TestTable', [], function(ignored, resutSet3) { if (!resutSet3.rows) { throw newSQLError('Missing resutSet3.rows'); } if (!resutSet3.rows.length) { throw newSQLError('Missing resutSet3.rows.length'); } if (resutSet3.rows.length !== 1) { throw newSQLError("Incorrect resutSet3.rows.length value: " + resutSet3.rows.length + " (expected: 1)"); } if (!resutSet3.rows.item(0).id) { throw newSQLError('Missing resutSet3.rows.item(0).id'); } if (resutSet3.rows.item(0).id === firstid) { throw newSQLError("resutSet3.rows.item(0).id value " + (resutSet3.rows.item(0).id) + " incorrectly matches previous unique key id value value (" + firstid + ")"); } if (!resutSet3.rows.item(0).data) { throw newSQLError('Missing resutSet3.rows.item(0).data'); } if (resutSet3.rows.item(0).data !== 123) { throw newSQLError("Incorrect resutSet3.rows.item(0).data value: " + (resutSet3.rows.item(0).data) + " (expected 123)"); } return secondReadTransactionFinished = true; }); }, function(tx4_err) { return SelfTest.finishWithError(errorcb, "second readTransaction error: " + tx4_err); }, function() { if (!secondReadTransactionFinished) { SelfTest.finishWithError(errorcb, 'second readTransaction did not finish'); return; } db.close(function() { SelfTest.cleanupAndFinish(successcb, errorcb); }, function(close_err) { SelfTest.finishWithError(errorcb, "close error: " + close_err); }); });
<<<<<<< // TBD Test for Android Web SQL ONLY in this version branch: if (isWP8) pending('NOT IMPLEMENTED for WP8'); if (isWindows) pending('NOT IMPLEMENTED for Windows'); if (!isWebSql && !isWindows && isAndroid) pending('SKIP for Android plugin'); // TBD SKIP for Android plugin (for now) ======= if (isWP8) pending('NOT IMPLEMENTED for WP8 (plugin)'); if (isWindows) pending('NOT IMPLEMENTED for Windows (plugin)'); if (!isWebSql && !isWindows && isAndroid) pending('SKIP for Android plugin'); // TBD SKIP for Android plugin (for now) >>>>>>> // TBD Test for Android Web SQL ONLY in this version branch: if (isWP8) pending('NOT IMPLEMENTED for WP8 (plugin)'); if (isWindows) pending('NOT IMPLEMENTED for Windows (plugin)'); if (!isWebSql && !isWindows && isAndroid) pending('SKIP for Android plugin'); // TBD SKIP for Android plugin (for now) <<<<<<< // TBD REMOVE from version branches such as cordova-sqlite-ext: if (!isWebSql && !isAndroid && !isWindows && !isWP8) pending('NOT IMPLEMENTED for iOS/macOS plugin'); ======= if (!isWebSql && !isAndroid && !isWindows && !isWP8) pending('NOT IMPLEMENTED for iOS/macOS plugin'); >>>>>>> // TBD REMOVE from version branches such as cordova-sqlite-ext: if (!isWebSql && !isAndroid && !isWindows && !isWP8) pending('NOT IMPLEMENTED for iOS/macOS plugin');
<<<<<<< insertChildHTML_: function (child, before, desktop) { jq(this.$n('pp')).append(child.redrawHTML_()); //color palette and color picker child.bind(desktop); }, popupDomContent_:function (){//override toolbarbutton, color picker draw pp dom at another location return ''; }, ======= >>>>>>>
<<<<<<< /** * ================================================================================================================= ======= /* >>>>>>> /* * ================================================================================================================= <<<<<<< * var stage = new createjs.StageGL("canvasElementId"); ======= * var stage = new createjs.StageGL("canvasElementId", false, false); * stage.updateViewport(800, 600); //LM: Is this necessary in this example? Could you use canvas.width instead? >>>>>>> * var stage = new createjs.StageGL("canvasElementId", false, false); <<<<<<< * createjs.Ticker.addEventListener("tick", function(event) { ======= * createjs.Ticker.on("tick", handleTick); * * function handleTick(event) { >>>>>>> * createjs.Ticker.on("tick", handleTick); * * function handleTick(event) { <<<<<<< * - StageGL is not included in the current minified version of EaselJS. * - {{#crossLink "SpriteContainer"}}{{/crossLink}} was required by previous versions but is deprecated. * - Previous versions had hard limitations about images per container etc, these have been removed. ======= * - StageGL is not currently included in the minified version of EaselJS. * - {{#crossLink "SpriteContainer"}}{{/crossLink}} (the previous approach to WebGL with EaselJS) has been deprecated. * - Earlier versions of WebGL support in EaselJS (SpriteStage and SpriteContainer) had hard limitations on images * per container, which have been solved. >>>>>>> * - StageGL is not currently included in the minified version of EaselJS. * - {{#crossLink "SpriteContainer"}}{{/crossLink}} (the previous approach to WebGL with EaselJS) has been deprecated. * - Earlier versions of WebGL support in EaselJS (SpriteStage and SpriteContainer) had hard limitations on images * per container, which have been solved. <<<<<<< * @param {HTMLCanvasElement | String | Object} canvas A canvas object that the StageGL will render to, or the string id * of a canvas object in the current document. * @param {Object} options All the option parameters in a refernce object. * @param {Boolean} [options.preserveBuffer=0] If true, the canvas is NOT auto-cleared by WebGL (spec discourages true). * Useful if you want to persistent draw effects. * @param {Boolean} [options.antialias=false] Specifies whether or not the browser's WebGL implementation should try to perform antialiasing, this varies between graphics cards and browsers. * Will also enable Linear pixel sampling on power of two textures (smoother images) * @param {Boolean} [options.transparent=false] If true, the canvas is transparent. This is VERY expensive, and thus defaults to false, unlike context2D. * @param {Boolean} [options.premultiply=false] Alters colour handling. If true assumes the shader must account for premultiplied alpha. * This can help avoid visual halo effects with some assets, but may also cause problems with other assets. * @param {Integer} [options.autoPurge=1200] How often the system should automatically dump unused textures with `purgeTextures(autoPurge)` every `autoPurge/2` draws. ======= * @param {HTMLCanvasElement | String | Object} canvas A canvas object that StageGL will render to, or the string id * of a canvas object in the current DOM. * @param {Object} options All the option parameters in a reference object. * @param {Boolean} [options.preserveBuffer=0] If `true`, the canvas is NOT auto-cleared by WebGL (the spec * discourages setting this to `true`). This is useful if you want persistent draw effects. * @param {Boolean} [options.antialias=false] Specifies whether or not the browser's WebGL implementation should try * to perform anti-aliasing. This will also enable linear pixel sampling on power-of-two textures (smoother images). * @param {Boolean} [options.transparent=false] If `true`, the canvas is transparent. This is <strong>very</strong> * expensive, and should be used with caution. * @param {Boolean} [options.premultiply=false] Alters color handling. If `true`, this assumes the shader must * account for pre-multiplied alpha. This can help avoid visual halo effects with some assets, but may also cause * problems with other assets. * @param {Integer} [options.autoPurge=1200] How often the system should automatically dump unused textures with * `purgeTextures(autoPurge)` every `autoPurge/2` draws. See {{#crossLink "purgeTextures"}}{{/crossLink}} for more * information. >>>>>>> * @param {HTMLCanvasElement | String | Object} canvas A canvas object that StageGL will render to, or the string id * of a canvas object in the current DOM. * @param {Object} options All the option parameters in a reference object. * @param {Boolean} [options.preserveBuffer=0] If `true`, the canvas is NOT auto-cleared by WebGL (the spec * discourages setting this to `true`). This is useful if you want persistent draw effects. * @param {Boolean} [options.antialias=false] Specifies whether or not the browser's WebGL implementation should try * to perform anti-aliasing. This will also enable linear pixel sampling on power-of-two textures (smoother images). * @param {Boolean} [options.transparent=false] If `true`, the canvas is transparent. This is <strong>very</strong> * expensive, and should be used with caution. * @param {Boolean} [options.premultiply=false] Alters color handling. If `true`, this assumes the shader must * account for pre-multiplied alpha. This can help avoid visual halo effects with some assets, but may also cause * problems with other assets. * @param {Integer} [options.autoPurge=1200] How often the system should automatically dump unused textures with * `purgeTextures(autoPurge)` every `autoPurge/2` draws. See {{#crossLink "purgeTextures"}}{{/crossLink}} for more * information. <<<<<<< * Calculate the U/V co-ordinate based info for sprite frames. Instead of pixel count it uses a 0-1 space. * Also includes the ability to get info back for a specific frame or only calculate that one frame. * * //generate UV rects for all entries * StageGL.buildUVRects( spriteSheetA ); * //generate all, fetch the first * var firstFrame = StageGL.buildUVRects( spriteSheetB, 0 ); * //generate the rect for just a single frame for performance's sake * var newFrame = StageGL.buildUVRects( dynamicSpriteSheet, newFrameIndex, true ); * * NOTE: This method is mainly for internal use, though it may be useful for advanced uses. * @param {SpriteSheet} spritesheet The spritesheet to find the frames on * @param {int} [target=-1] The frame to return ======= * Calculate the U/V co-ordinate-based info for sprite frames. Instead of pixel count it uses a 0-1 space. It also * includes the ability to get info back for a specific frame, or only calculate that one frame. * @method buildUVRects * @param {SpriteSheet} spritesheet The sprite sheet to find {{#crossLink "StageGL/_frames:property"}}{{/crossLink}} on. * @param {frame} [target=-1] The frame to return >>>>>>> * Calculate the U/V co-ordinate based info for sprite frames. Instead of pixel count it uses a 0-1 space. * Also includes the ability to get info back for a specific frame, or only calculate that one frame. * * //generate UV rects for all entries * StageGL.buildUVRects( spriteSheetA ); * //generate all, fetch the first * var firstFrame = StageGL.buildUVRects( spriteSheetB, 0 ); * //generate the rect for just a single frame for performance's sake * var newFrame = StageGL.buildUVRects( dynamicSpriteSheet, newFrameIndex, true ); * * NOTE: This method is mainly for internal use, though it may be useful for advanced uses. * @param {SpriteSheet} spritesheet The spritesheet to find the frames on * @param {int} [target=-1] The frame to return <<<<<<< * Render textures can't draw into themselves so any item being used for renderTextures needs two to alternate between. * This function creates, gets, and toggles the render surface between the two. ======= * Render textures can't draw into themselves so any item being used for renderTextures needs two. This function * creates, gets, and toggles the render surface. >>>>>>> * Render textures can't draw into themselves so any item being used for renderTextures needs two to alternate between. * This function creates, gets, and toggles the render surface between the two. <<<<<<< * For every image encountered StageGL registers and tracks it automatically. * This tracking can cause memory leaks if not purged. * StageGL, by default, automatically fixes this. This does take performance and may unfortunately feature false positives. * This function is for manual management of this memory instead of the automatic system. * * This function will recursively remove all textures found on the object, its children, cache, etc. * It will uncache objects and remove any texture it finds REGARDLESS of whether it is currently in use elsewhere. * It is up to the user to ensure that a texture in use is not removed. * * Textures in use, or to be used again shortly, should not be removed. This is simply for performance reasons. * Removing a texture in use will cause the texture to have to be re-uploaded slowing rendering. ======= * For every image encountered it is registered and tracked automatically. When all items using an image are removed * from the stage it's recommended to remove it manually to prevent memory leaks. This function will remove all * textures found on the object and its children, cache, etc. Specifically it will also un-cache, cached objects * that it finds. This happens instantly, so aggressive use could result in performance problems. If you remove a * texture and add it again later(by rendering an object using it for example) the texture will get re-added and * need re-removing later. >>>>>>> * For every image encountered StageGL registers and tracks it automatically. This tracking can cause memory leaks * if not purged. StageGL, by default, automatically fixes this. This does take performance and may unfortunately * feature false positives. This function is for manual management of this memory instead of the automatic system. * * This function will recursively remove all textures found on the object, its children, cache, etc. It will uncache * objects and remove any texture it finds REGARDLESS of whether it is currently in use elsewhere. It is up to the user * to ensure that a texture in use is not removed. * * Textures in use, or to be used again shortly, should not be removed. This is simply for performance reasons. * Removing a texture in use will cause the texture to have to be re-uploaded slowing rendering. <<<<<<< * Returns a base texture (see {{#crossLink "StageGL/getBaseTexture"}}{{/crossLink}}) for details. * Also includes an attached and linked render buffer in texture._frameBuffer. * RenderTextures can be thought of as an internal canvas that can be drawn to. ======= * Returns a base texture (see {{#crossLink "StageGL/getBaseTexture"}}{{/crossLink}}) with an attached render buffer * in `texture._frameBuffer`. >>>>>>> * Returns a base texture (see {{#crossLink "StageGL/getBaseTexture"}}{{/crossLink}}) for details. * Also includes an attached and linked render buffer in `texture._frameBuffer`. RenderTextures * can be thought of as an internal canvas that can be drawn to. <<<<<<< * Actually make sure the texture handed into the function is removed and cleaned. * Mostly for internal use, recommended to call {{#crossLink "StageGL/releaseTexture"}}{{/crossLink}} instead. * *Note: Testing shows this may not happen immediately, have to wait for WebGL to have actually finish removal. ======= * removed and cleaned the texture. Mostly for internal use, recommended to call {{#crossLink "StageGL/releaseTexture"}}{{/crossLink}} instead. >>>>>>> * Remove and clean the texture, expects a texture and is inflexible. Mostly for internal use, recommended to call * {{#crossLink "StageGL/releaseTexture"}}{{/crossLink}} instead as it will call this with the correct texture object(s). * *Note: Testing shows this may not happen immediately, have to wait for WebGL to have actually update memory. <<<<<<< * @param {Boolean} ignoreCache * @method _batchDraw ======= * @param {WebGLRenderingContext} ignoreCache * @protected * @todo Review the ignoreCache parameter. Is it a context or a boolean? >>>>>>> * @param {Boolean} ignoreCache * @protected <<<<<<< ======= * @return {Boolean} If the draw was handled by this function * @protected >>>>>>> * @protected <<<<<<< /** * Sub protion of _cacheDraw, do not call independently. * @method _drawFilters * @param {DisplayObject} target The object we're drawing with a filter. * @param {Array} filters The filters we're drawing into cache. * @param {BitmapCache} manager The BitmapCache instance looking after the cache **/ ======= /** * @method _drawFilters * @param target * @param filters * @param manager * @protected * @todo Please doc this method */ >>>>>>> /** * Sub portion of _cacheDraw, do not call independently. * @method _drawFilters * @param {DisplayObject} target The object we're drawing with a filter. * @param {Array} filters The filters we're drawing into cache. * @param {BitmapCache} manager The BitmapCache instance looking after the cache **/ <<<<<<< * You may wish to create your own StageGL instance to control factors like background color/transparency, AA, and others. * If you do, pass a new instance in instead of 'true' but set " {{#crossLink "StageGL/isCacheControlled"}}{{/crossLink}} " to true on your instance. * This will trigger it to behave correctly, and not assume your main context is WebGL. Do not set it to true if you passed in your own stage. * * @pubic ======= * You can make your own StageGL and have it render to a canvas if you set ".isCacheControlled" to true on your stage. * You may wish to create your own StageGL instance to control factors like background color/transparency, AA, and etc. * You must set "options" to its own stage if you wish to use the fast Render Textures available only to StageGLs. * If you use WebGL cache on a container with Shapes you will have to cache each shape individually before the container, * otherwise the WebGL cache will not render the shapes. * @public >>>>>>> * You may wish to create your own StageGL instance to control factors like background color/transparency, AA, and others. * If you do, pass a new instance in instead of 'true' but set " {{#crossLink "StageGL/isCacheControlled"}}{{/crossLink}} " * to true on your instance. This will trigger it to behave correctly, and not assume your main context is WebGL. * Do not set it to true if you passed in your own stage. * * @public
<<<<<<< active={isDragging} staticLegendHeight={staticLegendHeight} ======= active={!!isDragging} >>>>>>> active={!!isDragging} staticLegendHeight={staticLegendHeight}
<<<<<<< module.exports = function (fn, options) { var keys = []; ======= module.exports = function (fn) { >>>>>>> module.exports = function (fn, options) {
<<<<<<< ======= import DomUtils from './domUtils' import './soundtouch' >>>>>>> import DomUtils from './domUtils'
<<<<<<< const util = require('util'); const accessAsync = util.promisify(fs.access); const config = ('../lib/config'); ======= >>>>>>> const util = require('util'); const accessAsync = util.promisify(fs.access); const config = ('../lib/config'); <<<<<<< const { path } = params; try { await accessAsync(path, fs.constants.F_OK | fs.constants.R_OK); await accessAsync(path + '/LOCK' || path + 'LOCK', fs.constants.F_OK | fs.constants.R_OK | fs.constants.W_OK); await accessAsync(path + '/LOG' || path + 'LOG', fs.constants.F_OK | fs.constants.R_OK | fs.constants.W_OK); } catch (err) { throw new Error('Invalid wallet path'); } const storage = params.storage || new Storage({ path, errorIfExists: false, createIfMissing: false }); const loadedWallet = await storage.loadWallet(); ======= const { chain, network, name } = params; let { storage } = params; storage = storage || new Storage({ errorIfExists: false, createIfMissing: false }); const loadedWallet = await storage.loadWallet({ chain, network, name }); >>>>>>> const { chain, network, name } = params; try { await accessAsync(path, fs.constants.F_OK | fs.constants.R_OK); await accessAsync(path + '/LOCK' || path + 'LOCK', fs.constants.F_OK | fs.constants.R_OK | fs.constants.W_OK); await accessAsync(path + '/LOG' || path + 'LOG', fs.constants.F_OK | fs.constants.R_OK | fs.constants.W_OK); } catch (err) { throw new Error('Invalid wallet path'); } let { storage } = params; storage = storage || new Storage({ errorIfExists: false, createIfMissing: false }); const loadedWallet = await storage.loadWallet({ chain, network, name });
<<<<<<< var blockHash = block.hash.toString(); console.log('Block received! ' + JSON.stringify(blockHash)); _getBlocks(); ======= console.log('Block received! ' + JSON.stringify(block)); var blockHash = block.toString(); if (parseInt($scope.blocks.length, 10) > parseInt(BLOCKS_DISPLAYED, 10) - 1) { $scope.blocks.pop(); } _getBlock(blockHash); >>>>>>> var blockHash = block.toString(); console.log('Block received! ' + JSON.stringify(blockHash)); _getBlocks();
<<<<<<< Script.prototype.isPubkey = function() { return (this.chunks.length == 2 && Buffer.isBuffer(this.chunks[0]) && this.chunks[1] == OP_CHECKSIG); }; ======= var util = b.util || require('./util/util'); var Parser = b.Parser || require('./util/BinaryParser').class(); var Put = b.Put || require('bufferput'); var TX_UNKNOWN = 0; var TX_PUBKEY = 1; var TX_PUBKEYHASH = 2; var TX_MULTISIG = 3; var TX_SCRIPTHASH = 4; var TX_TYPES = [ 'unknown', 'pubkey', 'pubkeyhash', 'multisig', 'scripthash' ]; function Script(buffer) { if (buffer) { this.buffer = buffer; } else { this.buffer = util.EMPTY_BUFFER; } this.chunks = []; this.parse(); } this.class = Script; Script.TX_UNKNOWN = TX_UNKNOWN; Script.TX_PUBKEY = TX_PUBKEY; Script.TX_PUBKEYHASH = TX_PUBKEYHASH; Script.TX_MULTISIG = TX_MULTISIG; Script.TX_SCRIPTHASH = TX_SCRIPTHASH; Script.prototype.parse = function() { this.chunks = []; var parser = new Parser(this.buffer); while (!parser.eof()) { var opcode = parser.word8(); var len; if (opcode > 0 && opcode < OP_PUSHDATA1) { // Read some bytes of data, opcode value is the length of data this.chunks.push(parser.buffer(opcode)); } else if (opcode == OP_PUSHDATA1) { len = parser.word8(); this.chunks.push(parser.buffer(len)); } else if (opcode == OP_PUSHDATA2) { len = parser.word16le(); this.chunks.push(parser.buffer(len)); } else if (opcode == OP_PUSHDATA4) { len = parser.word32le(); this.chunks.push(parser.buffer(len)); } else { this.chunks.push(opcode); } } }; >>>>>>> Script.prototype.isPubkey = function() { return (this.chunks.length == 2 && Buffer.isBuffer(this.chunks[0]) && this.chunks[1] == OP_CHECKSIG); }; <<<<<<< } }; Script.prototype.getRawOutType = function() { return TX_TYPES[this.classify()]; }; Script.prototype.simpleOutHash = function() { switch (this.getOutType()) { case 'Address': return this.chunks[2]; case 'Pubkey': return util.sha256ripe160(this.chunks[0]); default: log.debug("Encountered non-standard scriptPubKey"); log.debug("Strange script was: " + this.toString()); return null; } }; Script.prototype.getInType = function() { if (this.chunks.length == 1) { // Direct IP to IP transactions only have the public key in their scriptSig. return 'Pubkey'; } else if (this.chunks.length == 2 && Buffer.isBuffer(this.chunks[0]) && Buffer.isBuffer(this.chunks[1])) { return 'Address'; } else { return 'Strange'; } }; Script.prototype.simpleInPubKey = function() { switch (this.getInType()) { case 'Address': return this.chunks[1]; case 'Pubkey': return null; default: log.debug("Encountered non-standard scriptSig"); log.debug("Strange script was: " + this.toString()); return null; } }; Script.prototype.getBuffer = function() { return this.buffer; }; Script.fromStringContent = function(s) { var chunks = []; var split = s.split(' '); for (var i = 0; i < split.length; i++) { var word = split[i]; if (word.length > 2 && word.substring(0, 2) === '0x') { chunks.push(new Buffer(word.substring(2, word.length), 'hex')); } else { var opcode = Opcode.map['OP_' + word]; if (opcode) { chunks.push(opcode); } else { var integer = parseInt(word); if (!isNaN(integer)) { //console.log(integer+' bits=\t'+integer.toString(2).replace('-','').length); var data = util.intToBuffer(integer); chunks.push(data); } } } } return Script.fromChunks(chunks); }; Script.prototype.getStringContent = function(truncate, maxEl) { if (truncate === null) { truncate = true; } if ('undefined' === typeof maxEl) { maxEl = 15; } var s = ''; for (var i = 0, l = this.chunks.length; i < l; i++) { var chunk = this.chunks[i]; if (i > 0) { s += ' '; ======= } }; Script.prototype.simpleInPubKey = function() { switch (this.getInType()) { case 'Address': return this.chunks[1]; case 'Pubkey': return null; default: log.debug("Encountered non-standard scriptSig"); log.debug("Strange script was: " + this.toString()); return null; } }; Script.prototype.getBuffer = function() { return this.buffer; }; Script.prototype.getStringContent = function(truncate, maxEl) { if (truncate === null) { truncate = true; >>>>>>> } }; Script.prototype.getRawOutType = function() { return TX_TYPES[this.classify()]; }; Script.prototype.simpleOutHash = function() { switch (this.getOutType()) { case 'Address': return this.chunks[2]; case 'Pubkey': return util.sha256ripe160(this.chunks[0]); default: log.debug("Encountered non-standard scriptPubKey"); log.debug("Strange script was: " + this.toString()); return null; } }; Script.prototype.getInType = function() { if (this.chunks.length == 1) { // Direct IP to IP transactions only have the public key in their scriptSig. return 'Pubkey'; } else if (this.chunks.length == 2 && Buffer.isBuffer(this.chunks[0]) && Buffer.isBuffer(this.chunks[1])) { return 'Address'; } else { return 'Strange'; } }; Script.prototype.simpleInPubKey = function() { switch (this.getInType()) { case 'Address': return this.chunks[1]; case 'Pubkey': return null; default: log.debug("Encountered non-standard scriptSig"); log.debug("Strange script was: " + this.toString()); return null; } }; Script.prototype.getBuffer = function() { return this.buffer; }; Script.prototype.getStringContent = function(truncate, maxEl) { if (truncate === null) { truncate = true; } if ('undefined' === typeof maxEl) { maxEl = 15; } var s = ''; for (var i = 0, l = this.chunks.length; i < l; i++) { var chunk = this.chunks[i]; if (i > 0) { s += ' '; <<<<<<< }); var script = new Script(); script.chunks = testData; script.updateBuffer(); return script; }; Script.fromChunks = function(chunks) { var script = new Script(); script.chunks = chunks; script.updateBuffer(); return script; }; Script.chunksToBuffer = function(chunks) { var buf = new Put(); for (var i = 0, l = chunks.length; i < l; i++) { var data = chunks[i]; if (Buffer.isBuffer(data)) { if (data.length < OP_PUSHDATA1) { buf.word8(data.length); } else if (data.length <= 0xff) { buf.word8(OP_PUSHDATA1); buf.word8(data.length); } else if (data.length <= 0xffff) { buf.word8(OP_PUSHDATA2); buf.word16le(data.length); ======= if (dirty) { this.updateBuffer(); } }; /** * Creates a simple OP_CHECKSIG with pubkey output script. * * These are used for coinbase transactions and at some point were used for * IP-based transactions as well. */ Script.createPubKeyOut = function(pubkey) { var script = new Script(); script.writeBytes(pubkey); script.writeOp(OP_CHECKSIG); return script; }; /** * Creates a standard txout script. */ Script.createPubKeyHashOut = function(pubKeyHash) { var script = new Script(); script.writeOp(OP_DUP); script.writeOp(OP_HASH160); script.writeBytes(pubKeyHash); script.writeOp(OP_EQUALVERIFY); script.writeOp(OP_CHECKSIG); return script; }; Script.createMultisig = function(n_required, keys) { var script = new Script(); script.writeN(n_required); keys.forEach(function(key) { script.writeBytes(key); }); script.writeN(keys.length); script.writeOp(OP_CHECKMULTISIG); return script; }; Script.createP2SH = function(scriptHash) { var script = new Script(); script.writeOp(OP_HASH160); script.writeBytes(scriptHash); script.writeOp(OP_EQUAL); return script; }; Script.fromTestData = function(testData) { testData = testData.map(function(chunk) { if ("string" === typeof chunk) { return new Buffer(chunk, 'hex'); } else { return chunk; } }); var script = new Script(); script.chunks = testData; script.updateBuffer(); return script; }; Script.fromChunks = function(chunks) { var script = new Script(); script.chunks = chunks; script.updateBuffer(); return script; }; Script.fromHumanReadable = function(s) { return new Script(Script.stringToBuffer(s)); }; Script.prototype.toHumanReadable = function() { var s = ''; for (var i = 0, l = this.chunks.length; i < l; i++) { var chunk = this.chunks[i]; if (i > 0) { s += ' '; } if (Buffer.isBuffer(chunk)) { if (chunk.length === 0) { s += '0'; } else { s += '0x' + util.formatBuffer(encodeLen(chunk.length), 0) + ' '; s += '0x' + util.formatBuffer(chunk, 0); } } else { var opcode = Opcode.reverseMap[chunk]; if (typeof opcode === 'undefined') { opcode = '0x'+chunk.toString(16); } s += opcode; } } return s; }; Script.stringToBuffer = function(s) { var buf = new Put(); var split = s.split(' '); for (var i = 0; i < split.length; i++) { var word = split[i]; if (word === '') continue; if (word.length > 2 && word.substring(0, 2) === '0x') { // raw hex value //console.log('hex value'); buf.put(new Buffer(word.substring(2, word.length), 'hex')); } else { var opcode = Opcode.map['OP_' + word]; if (typeof opcode !== 'undefined') { // op code in string form //console.log('opcode'); buf.word8(opcode); } else { var integer = parseInt(word); if (!isNaN(integer)) { // integer //console.log('integer'); var data = util.intToBuffer(integer); buf.put(Script.chunksToBuffer([data])); } else if (word[0] === '\'' && word[word.length-1] === '\'') { // string //console.log('string'); word = word.substring(1,word.length-1); var hexString = ''; for(var c=0;c<word.length;c++) { hexString += ''+word.charCodeAt(c).toString(16); } buf.put(Script.chunksToBuffer([new Buffer(word)])); } else { throw new Error('Could not parse word "' +word+'" from script "'+s+'"'); } } } } return buf.buffer(); }; Script.chunksToBuffer = function(chunks) { var buf = new Put(); for (var i = 0, l = chunks.length; i < l; i++) { var data = chunks[i]; if (Buffer.isBuffer(data)) { if (data.length < OP_PUSHDATA1) { buf.word8(data.length); } else if (data.length <= 0xff) { buf.word8(OP_PUSHDATA1); buf.word8(data.length); } else if (data.length <= 0xffff) { buf.word8(OP_PUSHDATA2); buf.word16le(data.length); } else { buf.word8(OP_PUSHDATA4); buf.word32le(data.length); } buf.put(data); } else if ("number" === typeof data) { buf.word8(data); >>>>>>> }); var script = new Script(); script.chunks = testData; script.updateBuffer(); return script; }; Script.fromChunks = function(chunks) { var script = new Script(); script.chunks = chunks; script.updateBuffer(); return script; }; Script.fromHumanReadable = function(s) { return new Script(Script.stringToBuffer(s)); }; Script.prototype.toHumanReadable = function() { var s = ''; for (var i = 0, l = this.chunks.length; i < l; i++) { var chunk = this.chunks[i]; if (i > 0) { s += ' '; } if (Buffer.isBuffer(chunk)) { if (chunk.length === 0) { s += '0'; } else { s += '0x' + util.formatBuffer(encodeLen(chunk.length), 0) + ' '; s += '0x' + util.formatBuffer(chunk, 0); } } else { var opcode = Opcode.reverseMap[chunk]; if (typeof opcode === 'undefined') { opcode = '0x'+chunk.toString(16); } s += opcode; } } return s; }; Script.stringToBuffer = function(s) { var buf = new Put(); var split = s.split(' '); for (var i = 0; i < split.length; i++) { var word = split[i]; if (word === '') continue; if (word.length > 2 && word.substring(0, 2) === '0x') { // raw hex value //console.log('hex value'); buf.put(new Buffer(word.substring(2, word.length), 'hex')); } else { var opcode = Opcode.map['OP_' + word]; if (typeof opcode !== 'undefined') { // op code in string form //console.log('opcode'); buf.word8(opcode); } else { var integer = parseInt(word); if (!isNaN(integer)) { // integer //console.log('integer'); var data = util.intToBuffer(integer); buf.put(Script.chunksToBuffer([data])); } else if (word[0] === '\'' && word[word.length-1] === '\'') { // string //console.log('string'); word = word.substring(1,word.length-1); var hexString = ''; for(var c=0;c<word.length;c++) { hexString += ''+word.charCodeAt(c).toString(16); } buf.put(Script.chunksToBuffer([new Buffer(word)])); } else { throw new Error('Could not parse word "' +word+'" from script "'+s+'"'); } } } } return buf.buffer(); }; Script.chunksToBuffer = function(chunks) { var buf = new Put(); for (var i = 0, l = chunks.length; i < l; i++) { var data = chunks[i]; if (Buffer.isBuffer(data)) { if (data.length < OP_PUSHDATA1) { buf.word8(data.length); } else if (data.length <= 0xff) { buf.word8(OP_PUSHDATA1); buf.word8(data.length); } else if (data.length <= 0xffff) { buf.word8(OP_PUSHDATA2); buf.word16le(data.length);
<<<<<<< const util = require('../util'); ======= const db = require('../db'); >>>>>>> const util = require('../util'); const db = require('../db'); <<<<<<< if (!util.isBitcoinAddress(addr)) { return res.status(400).send({ error: 'Invalid bitcoin address', }); } logger.log('debug', 'Warning: Requesting data from Bcoin by address, may take some time'); // Get Bcoin data return request(`${API_URL}/tx/address/${addr}`, { timeout: TTL }, (error, bcoinRes, bcoinTxs) => { if (error) { logger.log('error', `${error}`); return res.status(404).send({}); } let txs = {}; try { txs = JSON.parse(bcoinTxs); } catch (e) { logger.log('error', `${e}`); return res.status(404).send({}); } ======= >>>>>>>
<<<<<<< // Return UI JSON return res.send({ txid: tx.hash, version: tx.version, time: tx.ps, blocktime: tx.ps, locktime: tx.locktime, blockhash: tx.block, fees: tx.fee / 1e8, confirmations: (height - tx.height) + 1, valueOut: tx.outputs.reduce((sum, output) => sum + output.value, 0) / 1e8, vin: tx.inputs.map(input => ({ addr: input.coin ? input.coin.address : '', value: input.coin ? input.coin.value / 1e8 : 0, scriptSig: { asm: input.script, }, })), vout: tx.outputs.map(output => ({ scriptPubKey: { asm: output.script, addresses: [output.address], }, value: output.value / 1e8, })), isCoinBase: tx.inputs[0].prevout.hash === '0000000000000000000000000000000000000000000000000000000000000000', }); ======= db.txs.getTxById(txid, (err, transaction) => { if (err) { logger.log('error', `/tx/:tid getTxById: ${err.err}`); return res.status(404).send(); } const tx = transaction; return res.send({ txid: tx.hash, version: tx.version, time: tx.ps, blocktime: tx.ps, locktime: tx.locktime, blockhash: tx.block, fees: tx.fee / 1e8, size: tx.size, confirmations: (height - tx.height) + 1, valueOut: tx.outputs.reduce((sum, output) => sum + output.value, 0) / 1e8, vin: tx.inputs.map(input => ({ addr: input.address, value: input.value / 1e8, })), vout: tx.outputs.map(output => ({ scriptPubKey: { addresses: [output.address], }, value: output.value / 1e8, })), isCoinBase: tx.inputs[0].prevout.hash === '0000000000000000000000000000000000000000000000000000000000000000', >>>>>>> db.txs.getTxById(txid, (err, transaction) => { if (err) { logger.log('error', `/tx/:tid getTxById: ${err.err}`); return res.status(404).send(); } const tx = transaction; return res.send({ txid: tx.hash, version: tx.version, time: tx.ps, blocktime: tx.ps, locktime: tx.locktime, blockhash: tx.block, fees: tx.fee / 1e8, size: tx.size, confirmations: (height - tx.height) + 1, valueOut: tx.outputs.reduce((sum, output) => sum + output.value, 0) / 1e8, vin: tx.inputs.map(input => ({ addr: input.address, value: input.value / 1e8, })), vout: tx.outputs.map(output => ({ scriptPubKey: { addresses: [output.address], }, value: output.value / 1e8, })), isCoinBase: tx.inputs[0].prevout.hash === '0000000000000000000000000000000000000000000000000000000000000000', <<<<<<< addr: input.coin ? input.coin.address : '', value: input.coin ? input.coin.value / 1e8 : 0, scriptSig: { asm: input.script, }, ======= addr: input.address, value: input.value / 1e8, >>>>>>> scriptSig: { asm: input.script, }, addr: input.address, value: input.value / 1e8, <<<<<<< addr: input.coin ? input.coin.address : '', value: input.coin ? input.coin.value / 1e8 : 0, scriptSig: { asm: input.script, }, ======= addr: input.address, value: input.value / 1e8, >>>>>>> scriptSig: { asm: input.script, }, addr: input.address, value: input.value / 1e8,
<<<<<<< angular.module('insight.system').controller('IndexController', ['$scope', 'Global', 'socket', 'Blocks', 'Transactions', function($scope, Global, socket, Blocks, Transactions) { ======= angular.module('insight.system').controller('IndexController', ['$scope', '$rootScope', 'Global', 'socket', 'Blocks', 'Transactions', function($scope, $rootScope, Global, socket, Blocks, Transactions) { >>>>>>> angular.module('insight.system').controller('IndexController', ['$scope', '$rootScope', 'Global', 'socket', 'Blocks', 'Transactions', function($scope, $rootScope, Global, socket, Blocks, Transactions) { <<<<<<< socket.on('connect', function() { socket.emit('subscribe', 'inv'); }); ======= //show errors $scope.flashMessage = $rootScope.flashMessage || null; >>>>>>> socket.on('connect', function() { socket.emit('subscribe', 'inv'); }); //show errors $scope.flashMessage = $rootScope.flashMessage || null;
<<<<<<< // For now, blocks handles these calls. // These will be replaced with more advanced mongo // No optimization yet. ======= // Will be replaced with a more sophisticated api soon >>>>>>> // For now, blocks handles these calls. // These will be replaced with more advanced mongo // No optimization yet. // Will be replaced with a more sophisticated api soon <<<<<<< // For Paging function getTransactions(params, options, limit, cb) { ======= function getTransactions(params, options, limit, skip, cb) { >>>>>>> function getTransactions(params, options, limit, skip, cb) { <<<<<<< // Req Change, refactor above function getTopTransactions(cb) { // Do not return mongo ids const defaultOptions = { _id: 0 }; // Query mongo Transactions.find( {}, (err, txs) => { if (err) { logger.log('error', `getTransactions: ${err}`); return cb(err); } if (!txs.length > 0) { return cb({ err: 'Tx not found' }); } return cb(null, txs); }) .sort({ height: -1 }) .limit(MAX_TXS); } ======= function getTxById(txid, cb) { getTransaction( { hash: txid }, { }, 1, 0, (err, transaction) => { if (err) { logger.log('error', `getTxById: ${txid} ${err.err}`); return cb(err); } return cb(null, transaction); }); } function getTxByBlock(blockHash, page, limit, cb) { getTransactions( { block: blockHash }, {}, limit, page * limit, (err, tx) => { if (err) { logger.log('error', `getTxByBlock: ${err.err}`); return cb(err); } if (!tx.length > 0) { return cb({ err: 'Tx not found' }); } return cb(null, tx); }); } function getTxByAddress(address, page, limit, cb) { getTransactions( { $or: [ { 'inputs.address': address }, { 'outputs.address': address }], }, {}, limit, page * limit, (err, tx) => { if (err) { logger.log('error', `getTxByAddress: ${err.err}`); return cb(err); } if (!tx.length > 0) { return cb({ err: 'Tx not found' }); } return cb(null, tx); }); } function getTxCountByBlock(blockHash, cb) { Transactions.count( { block: blockHash }, (err, count) => { if (err) { logger.log('error', `getTxCountByBlock ${err}`); return cb(err); } return cb(null, count); }); } function getTxCountByAddress(address, cb) { Transactions.count( { $or: [ { 'inputs.address': address }, { 'outputs.address': address }], }, (err, count) => { if (err) { logger.log('error', `getTxCountByAddress ${err}`); return cb(err); } return cb(null, count); }); } function updateInput(txid, inputid, value, address) { Transactions.findOneAndUpdate( { _id: txid, 'inputs._id': inputid }, { $set: { 'inputs.$.value': value, 'inputs.$.address': address, }, }, (err, tx) => { if (err) { logger.log('error', `updateInput: ${err}`); } }, ); } >>>>>>> // Req Change, refactor above function getTopTransactions(cb) { // Do not return mongo ids const defaultOptions = { _id: 0 }; // Query mongo Transactions.find( {}, (err, txs) => { if (err) { logger.log('error', `getTransactions: ${err}`); return cb(err); } if (!txs.length > 0) { return cb({ err: 'Tx not found' }); } return cb(null, txs); }) .sort({ height: -1 }) .limit(MAX_TXS); } function getTxById(txid, cb) { getTransaction( { hash: txid }, { }, 1, 0, (err, transaction) => { if (err) { logger.log('error', `getTxById: ${txid} ${err.err}`); return cb(err); } return cb(null, transaction); }); } function getTxByBlock(blockHash, page, limit, cb) { getTransactions( { block: blockHash }, {}, limit, page * limit, (err, tx) => { if (err) { logger.log('error', `getTxByBlock: ${err.err}`); return cb(err); } if (!tx.length > 0) { return cb({ err: 'Tx not found' }); } return cb(null, tx); }); } function getTxByAddress(address, page, limit, cb) { getTransactions( { $or: [ { 'inputs.address': address }, { 'outputs.address': address }], }, {}, limit, page * limit, (err, tx) => { if (err) { logger.log('error', `getTxByAddress: ${err.err}`); return cb(err); } if (!tx.length > 0) { return cb({ err: 'Tx not found' }); } return cb(null, tx); }); } function getTxCountByBlock(blockHash, cb) { Transactions.count( { block: blockHash }, (err, count) => { if (err) { logger.log('error', `getTxCountByBlock ${err}`); return cb(err); } return cb(null, count); }); } function getTxCountByAddress(address, cb) { Transactions.count( { $or: [ { 'inputs.address': address }, { 'outputs.address': address }], }, (err, count) => { if (err) { logger.log('error', `getTxCountByAddress ${err}`); return cb(err); } return cb(null, count); }); } function updateInput(txid, inputid, value, address) { Transactions.findOneAndUpdate( { _id: txid, 'inputs._id': inputid }, { $set: { 'inputs.$.value': value, 'inputs.$.address': address, }, }, (err, tx) => { if (err) { logger.log('error', `updateInput: ${err}`); } }, ); } <<<<<<< getTopTransactions, ======= getTxById, getTxByBlock, getTxCountByBlock, getTxByAddress, getTxCountByAddress, updateInput, >>>>>>> getTopTransactions, getTxById, getTxByBlock, getTxCountByBlock, getTxByAddress, getTxCountByAddress, updateInput,
<<<<<<< var addrs = []; ======= // Is it from genesis block? (testnet==livenet) // TODO: parse it from networks.genesisTX if (txid === genesisTXID) return cb(); >>>>>>> var addrs = []; // Is it from genesis block? (testnet==livenet) // TODO: parse it from networks.genesisTX if (txid === genesisTXID) return cb();
<<<<<<< eventBus.on('resetEditableWords', (region, uuid) => { if (uuid && uuid === editableUuid) { return } ======= const checkIsEmpty = () => { if (!element[0].textContent.trim().length) { element[0].classList.add('editable-words--outlined') } else { element[0].classList.remove('editable-words--outlined') } } eventBus.on('resetEditableWords', (region) => { >>>>>>> const checkIsEmpty = () => { if (!element[0].textContent.trim().length) { element[0].classList.add('editable-words--outlined') } else { element[0].classList.remove('editable-words--outlined') } } eventBus.on('resetEditableWords', (region, uuid) => { if (uuid && uuid === editableUuid) { return }
<<<<<<< iconSize: [11 , 10], iconAnchor: [20 , 0], popupAnchor: [-5, -5] ======= iconSize: [15 , 10], iconAnchor: [20 , 0], popupAnchor: [-5, -5] >>>>>>> iconSize: [11 , 10], iconAnchor: [20 , 0], popupAnchor: [-5, -5] <<<<<<< url: 'https://www.purpleair.com/data.json?fetchData=true&minimize=true&sensorsActive2=10080&orderby=L&nwlat=71.01695975726373&selat=4.390228926463396&nwlng=-172.79296875&selng=80.33203125', ======= url: 'https://www.purpleair.com/json?fetchData=true&minimize=true&sensorsActive2=10080&orderby=L', >>>>>>> url: 'https://www.purpleair.com/data.json?fetchData=true&minimize=true&sensorsActive2=10080&orderby=L&nwlat=71.01695975726373&selat=4.390228926463396&nwlng=-172.79296875&selng=80.33203125', <<<<<<< if(this._map.getZoom() >= 7){ var self = this; (function() { var script = document.createElement("SCRIPT"); script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'; script.type = 'text/javascript'; var zoom = self._map.getZoom(), northwest = self._map.getBounds().getNorthWest() , southeast = self._map.getBounds().getSouthEast() ; script.onload = function() { var $ = window.jQuery; var PurpleLayer_url = "https://www.purpleair.com/data.json?fetchData=true&minimize=true&sensorsActive2=10080&orderby=L&nwlat="+(northwest.lat)+"&selat="+(southeast.lat)+"&nwlng="+(northwest.lng)+"&selng="+(southeast.lng) ; $.getJSON(PurpleLayer_url , function(data){ self.parseData(data) ; }); }; document.getElementsByTagName("head")[0].appendChild(script); })(); } ======= var self = this; (function() { var script = document.createElement("SCRIPT"); script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'; script.type = 'text/javascript'; script.onload = function() { var $ = window.jQuery; var PurpleLayer_url = "https://www.purpleair.com/json?fetchData=true&minimize=true&sensorsActive2=10080&orderby=L"; map.spin(true) ; $.getJSON(PurpleLayer_url , function(data){ self.parseData(data) ; map.spin(false) ; }); }; document.getElementsByTagName("head")[0].appendChild(script); })(); >>>>>>> if(this._map.getZoom() >= 7){ var self = this; (function() { var script = document.createElement("SCRIPT"); script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'; script.type = 'text/javascript'; var zoom = self._map.getZoom(), northwest = self._map.getBounds().getNorthWest() , southeast = self._map.getBounds().getSouthEast() ; script.onload = function() { var $ = window.jQuery; var PurpleLayer_url = "https://www.purpleair.com/data.json?fetchData=true&minimize=true&sensorsActive2=10080&orderby=L&nwlat="+(northwest.lat)+"&selat="+(southeast.lat)+"&nwlng="+(northwest.lng)+"&selng="+(southeast.lng) ; map.spin(true) ; $.getJSON(PurpleLayer_url , function(data){ self.parseData(data) ; map.spin(false) ; }); }; document.getElementsByTagName("head")[0].appendChild(script); })(); } <<<<<<< var marker = this.getMarker(data) ; if(marker != null){ key = data[0] ; // ID ======= var marker = this.getMarker(data) ; if(marker != null){ key = data.ID ; >>>>>>> var marker = this.getMarker(data) ; if(marker != null){ key = data[0] ; // ID <<<<<<< for (i = 0 ; i < data.data.length ; i++) { this.addMarker(data.data[i]) ; ======= console.log(data.results.length) ; for (i = 0 ; i < data.results.length ; i++) { this.addMarker(data.results[i]) ; >>>>>>> for (i = 0 ; i < data.data.length ; i++) { this.addMarker(data.data[i]) ;
<<<<<<< },{"jquery":2,"leaflet":6}],9:[function(require,module,exports){ require('./purpleAirMarkerLayer.js') ; ======= },{}],9:[function(require,module,exports){ require('jquery') ; require('leaflet') ; >>>>>>> },{}],9:[function(require,module,exports){ require('jquery') ; require('leaflet') ; require('./purpleAirMarkerLayer.js') ; <<<<<<< },{"./fractracker.js":8,"./mapKnitterLayer.js":10,"./odorReportLayer.js":11,"./openWeatherMapLayer.js":12,"./purpleAirMarkerLayer.js":13,"./purpleLayer.js":14,"./skyTruthLayer.js":15,"./toxicReleaseLayer.js":16,"leaflet-providers":5}],10:[function(require,module,exports){ require('jquery') ; require('leaflet') ; L.Icon.MapKnitterIcon = L.Icon.extend({ ======= },{"./fractracker.js":8,"./mapKnitterLayer.js":10,"./odorReportLayer.js":11,"./openWeatherMapLayer.js":12,"./purpleLayer.js":13,"./skyTruthLayer.js":14,"./toxicReleaseLayer.js":15,"jquery":2,"leaflet":6,"leaflet-providers":5}],10:[function(require,module,exports){ L.Icon.MapKnitterIcon = L.Icon.extend({ >>>>>>> },{"./fractracker.js":8,"./mapKnitterLayer.js":10,"./odorReportLayer.js":11,"./openWeatherMapLayer.js":12,"./purpleAirMarkerLayer.js":13,"./purpleLayer.js":14,"./skyTruthLayer.js":15,"./toxicReleaseLayer.js":16,"jquery":2,"leaflet":6,"leaflet-providers":5}],10:[function(require,module,exports){ L.Icon.MapKnitterIcon = L.Icon.extend({ <<<<<<< require('jquery') ; require('leaflet') ; L.Icon.PurpleAirMarkerIcon = L.Icon.extend({ options: { iconUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Location_dot_purple.svg/768px-Location_dot_purple.svg.png', iconSize: [15 , 10], iconAnchor: [20 , 0], popupAnchor: [-5, -5] } }); L.icon.purpleAirMarkerIcon = function () { return new L.Icon.PurpleAirMarkerIcon(); }; L.LayerGroup.PurpleAirMarkerLayer = L.LayerGroup.extend( { options: { url: 'https://www.purpleair.com/json?fetchData=true&minimize=true&sensorsActive2=10080&orderby=L', }, initialize: function (options) { options = options || {}; L.Util.setOptions(this, options); this._layers = {}; }, onAdd: function (map) { this._map = map; this.requestData(); }, onRemove: function (map) { this.clearLayers(); this._layers = {}; }, requestData: function () { var self = this; (function() { var script = document.createElement("SCRIPT"); script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'; script.type = 'text/javascript'; script.onload = function() { var $ = window.jQuery; var PurpleLayer_url = "https://www.purpleair.com/json?fetchData=true&minimize=true&sensorsActive2=10080&orderby=L"; $.getJSON(PurpleLayer_url , function(data){ self.parseData(data) ; }); }; document.getElementsByTagName("head")[0].appendChild(script); })(); }, getMarker: function (data) { var redDotIcon =new L.icon.purpleAirMarkerIcon(); var lat = data.Lat ; var lng = data.Lon; var value = parseFloat(data.PM2_5Value) ; //PM2.5 VALUE in microgram per metre cube var Label = data.Label ; var temp_f = data.temp_f ; var humidity = data.humidity ; var pressure = data.pressure ; var type = data.Type ; var hardware = data.DEVICE_HARDWAREDISCOVERED ; var purpleAirMarker ; if(lat!=null && lng!=null){ purpleAirMarker = L.marker([lat , lng] , {icon: redDotIcon}).bindPopup("<i style='color: purple ; size : 20px'>Label : " + Label + "</i><br><br> <strong>PM2.5 Value : " + value +"</strong><br><strong> Lat: " + lat + "</strong><br><strong> Lon: " + lng + "<br>Temp (F) : "+temp_f+"<br>Humidity : " + humidity + "<br>Pressure : " + pressure + "<br><br>Hardware type : " + type + "<br>DEVICE_HARDWAREDISCOVERED : "+hardware + "</strong><br><br> <i>Data provided by <a>www.purpleair.com</a></i>") ; } return purpleAirMarker ; }, addMarker: function (data) { var marker = this.getMarker(data) ; if(marker != null){ key = data.ID ; if (!this._layers[key]) { this._layers[key] = marker; this.addLayer(marker); } } }, parseData: function (data) { console.log(data.results.length) ; for (i = 0 ; i < data.results.length ; i++) { this.addMarker(data.results[i]) ; } } } ); L.layerGroup.purpleAirMarkerLayer = function (options) { return new L.LayerGroup.PurpleAirMarkerLayer(options) ; }; },{"jquery":2,"leaflet":6}],14:[function(require,module,exports){ require('jquery') ; require('leaflet') ; ======= >>>>>>> require('jquery') ; require('leaflet') ; L.Icon.PurpleAirMarkerIcon = L.Icon.extend({ options: { iconUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Location_dot_purple.svg/768px-Location_dot_purple.svg.png', iconSize: [15 , 10], iconAnchor: [20 , 0], popupAnchor: [-5, -5] } }); L.icon.purpleAirMarkerIcon = function () { return new L.Icon.PurpleAirMarkerIcon(); }; L.LayerGroup.PurpleAirMarkerLayer = L.LayerGroup.extend( { options: { url: 'https://www.purpleair.com/json?fetchData=true&minimize=true&sensorsActive2=10080&orderby=L', }, initialize: function (options) { options = options || {}; L.Util.setOptions(this, options); this._layers = {}; }, onAdd: function (map) { this._map = map; this.requestData(); }, onRemove: function (map) { this.clearLayers(); this._layers = {}; }, requestData: function () { var self = this; (function() { var script = document.createElement("SCRIPT"); script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'; script.type = 'text/javascript'; script.onload = function() { var $ = window.jQuery; var PurpleLayer_url = "https://www.purpleair.com/json?fetchData=true&minimize=true&sensorsActive2=10080&orderby=L"; $.getJSON(PurpleLayer_url , function(data){ self.parseData(data) ; }); }; document.getElementsByTagName("head")[0].appendChild(script); })(); }, getMarker: function (data) { var redDotIcon =new L.icon.purpleAirMarkerIcon(); var lat = data.Lat ; var lng = data.Lon; var value = parseFloat(data.PM2_5Value) ; //PM2.5 VALUE in microgram per metre cube var Label = data.Label ; var temp_f = data.temp_f ; var humidity = data.humidity ; var pressure = data.pressure ; var type = data.Type ; var hardware = data.DEVICE_HARDWAREDISCOVERED ; var purpleAirMarker ; if(lat!=null && lng!=null){ purpleAirMarker = L.marker([lat , lng] , {icon: redDotIcon}).bindPopup("<i style='color: purple ; size : 20px'>Label : " + Label + "</i><br><br> <strong>PM2.5 Value : " + value +"</strong><br><strong> Lat: " + lat + "</strong><br><strong> Lon: " + lng + "<br>Temp (F) : "+temp_f+"<br>Humidity : " + humidity + "<br>Pressure : " + pressure + "<br><br>Hardware type : " + type + "<br>DEVICE_HARDWAREDISCOVERED : "+hardware + "</strong><br><br> <i>Data provided by <a>www.purpleair.com</a></i>") ; } return purpleAirMarker ; }, addMarker: function (data) { var marker = this.getMarker(data) ; if(marker != null){ key = data.ID ; if (!this._layers[key]) { this._layers[key] = marker; this.addLayer(marker); } } }, parseData: function (data) { console.log(data.results.length) ; for (i = 0 ; i < data.results.length ; i++) { this.addMarker(data.results[i]) ; } } } ); L.layerGroup.purpleAirMarkerLayer = function (options) { return new L.LayerGroup.PurpleAirMarkerLayer(options) ; }; },{"jquery":2,"leaflet":6}],14:[function(require,module,exports){ <<<<<<< },{"heatmap.js":1,"jquery":2,"leaflet":6,"leaflet-heatmap":4}],15:[function(require,module,exports){ require('jquery') ; require('leaflet') ; ======= },{"heatmap.js":1,"leaflet-heatmap":4}],14:[function(require,module,exports){ >>>>>>> },{"heatmap.js":1,"leaflet-heatmap":4}],15:[function(require,module,exports){ <<<<<<< },{"jquery":2,"leaflet":6}],16:[function(require,module,exports){ require('jquery') ; require('leaflet') ; ======= },{}],15:[function(require,module,exports){ >>>>>>> },{}],16:[function(require,module,exports){
<<<<<<< require('./mapKnitterLayer.js') ; ======= require('./toxicReleaseLayer.js') ; >>>>>>> require('./mapKnitterLayer.js') ; require('./toxicReleaseLayer.js') ;
<<<<<<< require(path.join(__dirname, '..', '..', '..', 'node_modules', 'codemirror', 'addon', 'fold', 'xml-fold.js')) ======= require(path.join(__dirname, '..', '..', '..', 'node_modules', 'codemirror', 'addon', 'fold', 'xml-fold.js')) require(path.join(__dirname, '..', '..', '..', 'node_modules', 'codemirror', 'addon', 'comment', 'comment.js')) } } >>>>>>> require(path.join(__dirname, '..', '..', '..', 'node_modules', 'codemirror', 'addon', 'fold', 'xml-fold.js')) require(path.join(__dirname, '..', '..', '..', 'node_modules', 'codemirror', 'addon', 'fold', 'xml-fold.js')) require(path.join(__dirname, '..', '..', '..', 'node_modules', 'codemirror', 'addon', 'comment', 'comment.js'))
<<<<<<< // implementation of a chord diagram view of the job graph AMBROSE.chordView = function() { var ui, view; ======= /** * Ambrose module "chord" provides a chord diagram of the job graph. */ (function($, d3, colorbrewer, ambrose) { var chord = ambrose.chord = function(ui) { return new ambrose.chord.fn.init(ui); } // private reference to parent ui var _ui; // the svg graphic element, child of view var _svg; // job dependencies are visualized by chords var _diagram, _groups, _chords; >>>>>>> /** * Ambrose module "chord" provides a chord diagram of the job graph. */ (function($, d3, colorbrewer, ambrose) { var chord = ambrose.chord = function(ui) { return new ambrose.chord.fn.init(ui); } // private reference to parent ui var _ui; // the svg graphic element, child of view var _svg; // job dependencies are visualized by chords var _diagram, _groups, _chords; <<<<<<< // private members and methods above, public below return { divName: "chordView", tabName: "Chord", addDiv: function() { // add the div that the graph will render in $('#vizGroup').append('<div class="viz-pane tab-pane" id="' + this.divName + '"><div class=\'row\'><div class=\'span6\' id=\'chordViewViz\'></div><div class=\'span6\'><table id="job-props" class="table"><thead></thead><tbody></tbody></table></div></div></div>'); // add the tab div $('#vizTabs').append('<li><a href="#' + this.divName + '" data-toggle="tab">' + this.tabName + '</a></li>'); // if there is more than one graph, add unhide the nav tab and select the first tab if ($('.viz-pane').length < 2) { $('#vizTabs').show(); $('#vizTabs a:first').tab('show'); } else { $('#vizTabs').hide(); $('#' + this.divName).show(); } }, ======= function _handleJobSelected(event, data) { // TODO(Andy Schlaikjer): highlight the selected job } chord.fn = chord.prototype = { init: function(ui) { this.ui = _ui = ui; var chord = this; ui.bind('dagLoaded', function(event, data) { chord.initGraph(data.jobs); }); ui.bind('jobSelected JOB_STARTED JOB_FINISHED JOB_FAILED', function(event, data) { chord.refresh(); }); }, >>>>>>> function _handleJobSelected(event, data) { // TODO(Andy Schlaikjer): highlight the selected job } divName = "chordView"; tabName = "Chord"; function _addDiv() { // add the div that the graph will render in $('#vizGroup').append('<div class="viz-pane tab-pane" id="' + this.divName + '"><div class=\'row\'><div class=\'span6\' id=\'chordViewViz\'></div><div class=\'span6\'><table id="job-props" class="table"><thead></thead><tbody></tbody></table></div></div></div>'); // add the tab div $('#vizTabs').append('<li><a href="#' + this.divName + '" data-toggle="tab">' + this.tabName + '</a></li>'); // if there is more than one graph, add unhide the nav tab and select the first tab if ($('.viz-pane').length > 2) { $('#vizTabs').show(); $('#vizTabs a:first').tab('show'); } else { $('#vizTabs').hide(); $('#' + this.divName).show(); } } chord.fn = chord.prototype = { init: function(ui) { this.ui = _ui = ui; var chord = this; ui.bind('dagLoaded', function(event, data) { chord.initGraph(data.jobs); }); ui.bind('jobSelected JOB_STARTED JOB_FINISHED JOB_FAILED', function(event, data) { chord.refresh(); }); }, <<<<<<< svg = d3.select("#chordViewViz") ======= // TODO(Andy Schlaikjer): Is this safe in the presence of multiple view // impls which may want to add children to #chart element? Should this // instead reference the 'view' var? _svg = d3.select("#chart") >>>>>>> // TODO(Andy Schlaikjer): Is this safe in the presence of multiple view // impls which may want to add children to #chart element? Should this // instead reference the 'view' var? _svg = d3.select("#chordViewViz") <<<<<<< init: function(thatUi) { ui = thatUi; view = this; // once the dag is loaded we can initialize $(ui).bind( "dagLoaded", function(event, data) { view.initGraph(data.jobs); }) /** * Select the given job and update global state. */ $(ui).bind("jobSelected JOB_STARTED JOB_FINISHED JOB_FAILED JOB_PROGRESS", function(event, data) { view.refreshDisplay(event, data); }) }, refreshDisplay: refreshDisplay } } ======= refresh: function() { // update path.arc elements _svg.selectAll("path.arc") .transition() .style("fill", _jobColor) .style("stroke", _jobColor); // update path.chord elements _svg.selectAll("path.chord") .transition() .style("stroke", _chordStroke) .style("fill", _chordFill); }, }; // set the init function's prototype for later instantiation chord.fn.init.prototype = chord.fn; }(jQuery, d3, colorbrewer, AMBROSE)); >>>>>>> refresh: function() { // update path.arc elements _svg.selectAll("path.arc") .transition() .style("fill", _jobColor) .style("stroke", _jobColor); // update path.chord elements _svg.selectAll("path.chord") .transition() .style("stroke", _chordStroke) .style("fill", _chordFill); } }; // set the init function's prototype for later instantiation chord.fn.init.prototype = chord.fn; }(jQuery, d3, colorbrewer, AMBROSE));
<<<<<<< scriptTags: getTagsFromPropsList(TAG_NAMES.SCRIPT, [TAG_PROPERTIES.SRC], propsList), htmlAttributes: getHtmlAttributesFromPropsList(propsList) ======= scriptTags: getTagsFromPropsList(TAG_NAMES.SCRIPT, [TAG_PROPERTIES.SRC, TAG_PROPERTIES.INNER_HTML, TAG_PROPERTIES.NAME], propsList) >>>>>>> scriptTags: getTagsFromPropsList(TAG_NAMES.SCRIPT, [TAG_PROPERTIES.SRC, TAG_PROPERTIES.INNER_HTML, TAG_PROPERTIES.NAME], propsList), htmlAttributes: getHtmlAttributesFromPropsList(propsList)
<<<<<<< console.log(facingMode); getDeviceId(facingMode).then(function (deviceId) { ======= getDeviceId(facingMode, chooseDeviceId).then(function (deviceId) { >>>>>>> getDeviceId(facingMode, chooseDeviceId).then(function (deviceId) { <<<<<<< style: PropTypes.any, className: PropTypes.string }, _class.defaultProps = { delay: 500, maxImageSize: 1000, facingMode: 'rear' }, _temp); ======= style: PropTypes.object, className: PropTypes.string, chooseDeviceId: PropTypes.func }, _class.defaultProps = { delay: 500, style: {}, maxImageSize: 1000 }, _temp); >>>>>>> style: PropTypes.any, className: PropTypes.string, chooseDeviceId: PropTypes.func }, _class.defaultProps = { delay: 500, maxImageSize: 1000, facingMode: 'rear' }, _temp);
<<<<<<< , auth: { user: user , pass: pass } , maxMessages: 1 ======= >>>>>>> , maxMessages: 1
<<<<<<< if(data['updatedEntities'][0]['state']['next_state_transition_in'] !== undefined){ Unit.NextHarvest = data['updatedEntities'][0]['state']['next_state_transition_at']; Unit.NextAmount = data['updatedEntities'][0]['state']['current_product']['amount']; } if(data.responseData.militaryProducts.length > 5){ localStorage.setItem('LastAlcatrazUnits', JSON.stringify(data.responseData.militaryProducts)); } ======= if (Unit.alca !== null && postData !== undefined && postData[0] !== undefined && postData[0]['requestData'] !== undefined && postData[0]['requestData'][0] === Unit.alca.id) { if (data.responseData.militaryProducts === undefined) { return; } if (data.responseData.militaryProducts.length > 0) { localStorage.setItem('LastAlcatrazUnits', JSON.stringify(data.responseData.militaryProducts)); } } >>>>>>> if (Unit.alca !== null && postData !== undefined && postData[0] !== undefined && postData[0]['requestData'] !== undefined && postData[0]['requestData'][0] === Unit.alca.id) { if (data.responseData.militaryProducts === undefined) { return; } if(data['updatedEntities'][0]['state']['next_state_transition_in'] !== undefined){ Unit.NextHarvest = data['updatedEntities'][0]['state']['next_state_transition_at']; Unit.NextAmount = data['updatedEntities'][0]['state']['current_product']['amount']; } if(data.responseData.militaryProducts.length > 0){ localStorage.setItem('LastAlcatrazUnits', JSON.stringify(data.responseData.militaryProducts)); } <<<<<<< let top = [], text = '', alca = MainParser.CityMapData.find(obj => (obj['cityentity_id'] === 'X_ProgressiveEra_Landmark1')); ======= let top = []; Unit.RefreshAlca(); >>>>>>> let top = [], text = '', Unit.RefreshAlca(); <<<<<<< ======= let countDownDate = moment.unix(Unit.alca['state']['next_state_transition_at']); >>>>>>> <<<<<<< Unit.UpdateAlcaLable(countDownDate, x); text = HTML.i18nReplacer( i18n('Boxes.Units.NextUnitsIn'), { count: Unit.NextAmount, harvest: moment.unix(alca['state']['next_state_transition_at']).format('HH:mm:ss') }); } else { let countDownDate = moment.unix(alca['state']['next_state_transition_at']); let x = setInterval(function() { Unit.UpdateAlcaLable(countDownDate,x); }, 1000); Unit.UpdateAlcaLable(countDownDate, x); text = HTML.i18nReplacer( i18n('Boxes.Units.NextUnitsIn'), { count: alca.state.current_product.amount, harvest: moment.unix(alca['state']['next_state_transition_at']).format('HH:mm:ss') }); } ======= let timer = HTML.i18nReplacer( i18n('Boxes.Units.NextUnitsIn'), { count: Unit.alca.state.current_product.amount, harvest: moment.unix(Unit.alca['state']['next_state_transition_at']).format('HH:mm:ss') }); >>>>>>> Unit.UpdateAlcaLable(countDownDate, x); text = HTML.i18nReplacer( i18n('Boxes.Units.NextUnitsIn'), { count: Unit.NextAmount, harvest: moment.unix(alca['state']['next_state_transition_at']).format('HH:mm:ss') }); } else { let countDownDate = moment.unix(alca['state']['next_state_transition_at']); let x = setInterval(function() { Unit.UpdateAlcaLable(countDownDate,x); }, 1000); Unit.UpdateAlcaLable(countDownDate, x); text = HTML.i18nReplacer( i18n('Boxes.Units.NextUnitsIn'), { count: Unit.alca.state.current_product.amount, harvest: moment.unix(Unit.alca['state']['next_state_transition_at']).format('HH:mm:ss') }); }
<<<<<<< // PlayerDict MainParser.UpdatePlayerDict(data.responseData, 'StartUpService'); ======= // freigeschaltete Erweiterungen sichern MainParser.UnlockedAreas = data.responseData.city_map.unlocked_areas; >>>>>>> // PlayerDict MainParser.UpdatePlayerDict(data.responseData, 'StartUpService'); // freigeschaltete Erweiterungen sichern MainParser.UnlockedAreas = data.responseData.city_map.unlocked_areas;
<<<<<<< const collections = options.collections || []; ======= >>>>>>> const collections = options.collections || []; <<<<<<< collections: collections.join(), q: options.query, ======= query: options.query, >>>>>>> collections: collections.join(), query: options.query,
<<<<<<< var __values; var __read; var __spread; var __asyncGenerator; var __asyncDelegator; var __asyncValues; ======= var __exportStar; >>>>>>> var __exportStar; var __values; var __read; var __spread; var __asyncGenerator; var __asyncDelegator; var __asyncValues; <<<<<<< __values = function (o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; }; __read = function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; __spread = function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; }; __asyncGenerator = function (thisArg, _arguments, generator) { var g = generator.apply(thisArg, _arguments || []), q = [], c, i; return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { c = void 0, f(v), next(); } }; __asyncDelegator = function (o) { var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }; return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { return function (v) { return { value: ["delegate", (o[n] || f).call(o, v)], done: false }; }; } }; __asyncValues = function (o) { var m = o[Symbol.asyncIterator]; return m ? m.call(o) : __values(o); }; ======= __exportStar = function (m, exports) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; }; >>>>>>> __exportStar = function (m, exports) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; }; __values = function (o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; }; __read = function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; __spread = function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; }; __asyncGenerator = function (thisArg, _arguments, generator) { var g = generator.apply(thisArg, _arguments || []), q = [], c, i; return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { c = void 0, f(v), next(); } }; __asyncDelegator = function (o) { var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }; return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { return function (v) { return { value: ["delegate", (o[n] || f).call(o, v)], done: false }; }; } }; __asyncValues = function (o) { var m = o[Symbol.asyncIterator]; return m ? m.call(o) : __values(o); }; <<<<<<< exporter("__values", __values); exporter("__read", __read); exporter("__spread", __spread); exporter("__asyncGenerator", __asyncGenerator); exporter("__asyncDelegator", __asyncDelegator); exporter("__asyncValues", __asyncValues); }); ======= exporter("__exportStar", __exportStar); }); >>>>>>> exporter("__exportStar", __exportStar); exporter("__values", __values); exporter("__read", __read); exporter("__spread", __spread); exporter("__asyncGenerator", __asyncGenerator); exporter("__asyncDelegator", __asyncDelegator); exporter("__asyncValues", __asyncValues); });
<<<<<<< this.__state = null; this.__rawState = null; ======= this.state = null; this.__roots = null; >>>>>>> this.__state = null; this.__rawState = null; this.__roots = null;
<<<<<<< var existingWidget = global.__rerenderWidget; var widgetsContext = widgets.getWidgetsContext(out); ======= var rerenderWidget = global.__rerenderWidget; var widgetsContext = markoWidgets.getWidgetsContext(out); >>>>>>> var existingWidget = global.__rerenderWidget; var widgetsContext = markoWidgets.getWidgetsContext(out);
<<<<<<< function create(__markoHelpers) { var marko_loadTag = __markoHelpers.t, test_hello = marko_loadTag(require("./tags/test-hello/renderer")); ======= function create(__helpers) { var str = __helpers.s, empty = __helpers.e, notEmpty = __helpers.ne, escapeXml = __helpers.x, __loadTag = __helpers.t, test_hello_tag = __loadTag(require("./tags/test-hello/renderer")); >>>>>>> function create(__markoHelpers) { var marko_loadTag = __markoHelpers.t, test_hello_tag = marko_loadTag(require("./tags/test-hello/renderer"));
<<<<<<< if (isRerenderInBrowser !== true) { var targetNode = out.$__getOutput(); var fromEl; var targetEl = targetNode.firstChild; while(targetEl) { var id = targetEl.id; if (id) { fromEl = fromEls[id]; if (fromEl) { morphdom( fromEl, targetEl, componentsContext, onNodeAdded, onBeforeElUpdated, onBeforeNodeDiscarded, onNodeDiscarded, onBeforeElChildrenUpdated); } ======= var targetNode = out.$__getOutput(); var globalComponentsContext = out.global.components; var fromEl; var targetEl = targetNode.firstChild; while(targetEl) { var id = targetEl.id; if (id) { fromEl = fromEls[id]; if (fromEl) { morphdom( fromEl, targetEl, globalComponentsContext, onNodeAdded, onBeforeElUpdated, onBeforeNodeDiscarded, onNodeDiscarded, onBeforeElChildrenUpdated); >>>>>>> if (isRerenderInBrowser !== true) { var targetNode = out.$__getOutput(); var fromEl; var targetEl = targetNode.firstChild; while(targetEl) { var id = targetEl.id; if (id) { fromEl = fromEls[id]; if (fromEl) { morphdom( fromEl, targetEl, globalComponentsContext, onNodeAdded, onBeforeElUpdated, onBeforeNodeDiscarded, onNodeDiscarded, onBeforeElChildrenUpdated);
<<<<<<< var url = require('url') , express = require('express') , mirrorRouter = express.Router() , path = require('path') , fs = require('fs') , request = require('request'); mirrorRouter.use(function(req, res, next) { next(); }); mirrorRouter.get('/', function(req, res, next) { res.render('./../views/partial/mirror', { bodyClass: 'mirror' }); }); mirrorRouter.get('/weather.js', function(req, res, next) { res.writeHead(200, {'Content-Type': 'text/js'}); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/weather.js'), 'utf8')); res.end(); }); mirrorRouter.get('/news.js', function(req, res, next) { res.writeHead(200, {'Content-Type': 'text/js'}); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/news.js'), 'utf8')); res.end(); }); mirrorRouter.get('/stock.js', function(req, res, next) { res.writeHead(200, {'Content-Type': 'text/js'}); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/stock.js'), 'utf8')); res.end(); }); mirrorRouter.get('/traffic.js', function (req, res, next) { res.writeHead(200, {'Content-Type': 'text/js'}); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/traffic.js'), 'utf8')); res.end(); }); mirrorRouter.get('/mirror.js', function(req, res, next) { res.writeHead(200, {'Content-Type': 'text/js'}); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/mirror.js'), 'utf8')); res.end(); }); mirrorRouter.get('/authenticate.js', function(req, res, next) { res.writeHead(200, {'Content-Type': 'text/js'}); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/authenticate.js'), 'utf8')); res.end(); }); app.use('/mirror', mirrorRouter); ======= var url = require('url') , express = require('express') , mirrorRouter = express.Router() , path = require('path') , fs = require('fs') , Handlebars = require('handlebars') , request = require('request') , mongoose = require('mongoose') , nconf = require('nconf').file({ file: 'environment.json' }).env() , bingApiKey = nconf.get('BING_API_KEY'); mirrorRouter.use(function(req, res, next) { next(); }); mirrorRouter.get('/', function(req, res, next) { res.render('./../views/partials/mirror', { bodyClass: 'mirror', helpers:{} }); }); mirrorRouter.get('/weather.js', function(req, res, next) { res.writeHead(200, { 'Content-Type': 'text/js' }); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/weather.js'), 'utf8')); res.end(); }); mirrorRouter.get('/news.js', function(req, res, next) { res.writeHead(200, { 'Content-Type': 'text/js' }); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/news.js'), 'utf8')); res.end(); }); mirrorRouter.get('/stock.js', function(req, res, next) { res.writeHead(200, { 'Content-Type': 'text/js' }); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/stock.js'), 'utf8')); res.end(); }); mirrorRouter.get('/getTraffic', function(req, res, next) { var model = mongoose.model('Person'); var waypoint0 = "Seattle, WA"; var waypoint1 = "Redmond, WA"; request.get({ url: `http://dev.virtualearth.net/REST/V1/Routes/Driving?wp.0=${waypoint0}&wp.1=${waypoint1}&optmz=timeWithTraffic&key=${bingApiKey}`, }, function(error, response, body) { if (error) console.log(error) else { body = JSON.parse(body); if(body && body.resourceSets && body.resourceSets[0]){ var travelDuration = body.resourceSets[0].resources[0].travelDurationTraffic; var trafficCongestion = body.resourceSets[0].resources[0].trafficCongestion; //This can say "Heavy" or other things res.send({ "travelDuration": travelDuration, "trafficCongestion": trafficCongestion }); } } res.end(); }) }); mirrorRouter.get('/traffic.js', function(req, res, next) { res.writeHead(200, { 'Content-Type': 'text/js' }); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/traffic.js'), 'utf8')); res.end(); }); mirrorRouter.get('/mirror.js', function(req, res, next) { res.writeHead(200, { 'Content-Type': 'text/js' }); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/mirror.js'), 'utf8')); res.end(); }); mirrorRouter.get('/authenticate.js', function(req, res, next) { res.writeHead(200, { 'Content-Type': 'text/js' }); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/authenticate.js'), 'utf8')); res.end(); }); app.use('/mirror', mirrorRouter); >>>>>>> var url = require('url') , express = require('express') , mirrorRouter = express.Router() , path = require('path') , fs = require('fs') , Handlebars = require('handlebars') , request = require('request') , mongoose = require('mongoose') , nconf = require('nconf').file({ file: 'environment.json' }).env() , bingApiKey = nconf.get('BING_API_KEY'); mirrorRouter.use(function(req, res, next) { next(); }); mirrorRouter.get('/', function(req, res, next) { res.render('./../views/partials/mirror', { bodyClass: 'mirror', helpers:{} }); }); mirrorRouter.get('/weather.js', function(req, res, next) { res.writeHead(200, {'Content-Type': 'text/js'}); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/weather.js'), 'utf8')); res.end(); }); mirrorRouter.get('/news.js', function(req, res, next) { res.writeHead(200, {'Content-Type': 'text/js'}); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/news.js'), 'utf8')); res.end(); }); mirrorRouter.get('/stock.js', function(req, res, next) { res.writeHead(200, { 'Content-Type': 'text/js' }); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/stock.js'), 'utf8')); res.end(); }); mirrorRouter.get('/getTraffic', function(req, res, next) { var model = mongoose.model('Person'); var waypoint0 = "Seattle, WA"; var waypoint1 = "Redmond, WA"; request.get({ url: `http://dev.virtualearth.net/REST/V1/Routes/Driving?wp.0=${waypoint0}&wp.1=${waypoint1}&optmz=timeWithTraffic&key=${bingApiKey}`, }, function(error, response, body) { if (error) console.log(error) else { body = JSON.parse(body); if(body && body.resourceSets && body.resourceSets[0]){ var travelDuration = body.resourceSets[0].resources[0].travelDurationTraffic; var trafficCongestion = body.resourceSets[0].resources[0].trafficCongestion; //This can say "Heavy" or other things res.send({ "travelDuration": travelDuration, "trafficCongestion": trafficCongestion }); } } res.end(); }) }); mirrorRouter.get('/traffic.js', function (req, res, next) { res.writeHead(200, {'Content-Type': 'text/js'}); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/traffic.js'), 'utf8')); res.end(); }); mirrorRouter.get('/mirror.js', function(req, res, next) { res.writeHead(200, {'Content-Type': 'text/js'}); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/mirror.js'), 'utf8')); res.end(); }); mirrorRouter.get('/authenticate.js', function(req, res, next) { res.writeHead(200, {'Content-Type': 'text/js'}); res.write(fs.readFileSync(path.resolve(__dirname + '/../views/js/authenticate.js'), 'utf8')); res.end(); }); app.use('/mirror', mirrorRouter);
<<<<<<< } Authenticate.takePhoto = function(addFace, faceIdCallback) { ======= }; Authenticate.takePhoto = function(addFace) { >>>>>>> }; Authenticate.takePhoto = function(addFace) { <<<<<<< authenticated = true authenticating = false message.innerText = resultObj.name; Stock.init(resultObj.stock); //move your Traffic.init(resultObj.workAddress) here ======= authenticated = true; authenticating = false; // message.innerText = resultObj.message; Authenticate.user = { name: resultObj.name } document.dispatchEvent(new CustomEvent("mirrorstatechange", { detail: MIRROR_STATES.LOGGED_IN })); >>>>>>> authenticated = true; authenticating = false; // message.innerText = resultObj.message; Authenticate.user = { name: resultObj.name } document.dispatchEvent(new CustomEvent("mirrorstatechange", { detail: MIRROR_STATES.LOGGED_IN })); authenticated = true; authenticating = false; message.innerText = resultObj.name; Stock.init(resultObj.stock); //move your Traffic.init(resultObj.workAddress) here <<<<<<< Authenticate.handleFaces = function(args) { var context = facesCanvas.getContext('2d'); context.clearRect(0, 0, facesCanvas.width, facesCanvas.height); ======= Authenticate.determineEmotion = function() { checkEmotion = false; var Storage = Windows.Storage; var stream = new Storage.Streams.InMemoryRandomAccessStream(); mediaCapture.capturePhotoToStreamAsync(Windows.Media.MediaProperties.ImageEncodingProperties.createJpeg(), stream) .then(function () { var buffer = new Storage.Streams.Buffer(stream.size); stream.seek(0); stream.readAsync(buffer, stream.size, 0).done(function () { var dataReader = Storage.Streams.DataReader.fromBuffer(buffer); var byteArray = new Uint8Array(buffer.length); dataReader.readBytes(byteArray); console.log("Determining emotion"); $.ajax({ url: '/capture/determineEmotion', beforeSend: function (xhrObj) { xhrObj.setRequestHeader('Content-Type', 'application/octet-stream') }, type: 'POST', data: byteArray, processData: false }) .done(function (result) { console.log("successfully determined emotion"); var parsed = JSON.parse(result); if (parsed && parsed.quote && parsed.author) { quoteText.innerText = "\"" + parsed.quote + "\""; quoteAuthor.innerText = "- " + parsed.author; quotePane.style.display = "block"; } else { quotePane.style.display = "none"; } console.log("setting timeout"); setTimeout(function () { checkEmotion = true; quotePane.style.display = "none"; }, 20000); }) .fail(function (e) { console.error(e); checkEmotion = true; quotePane.style.display = "none"; }); }); }); } Authenticate.handleFaces = function(args) { >>>>>>> Authenticate.determineEmotion = function() { checkEmotion = false; var Storage = Windows.Storage; var stream = new Storage.Streams.InMemoryRandomAccessStream(); mediaCapture.capturePhotoToStreamAsync(Windows.Media.MediaProperties.ImageEncodingProperties.createJpeg(), stream) .then(function () { var buffer = new Storage.Streams.Buffer(stream.size); stream.seek(0); stream.readAsync(buffer, stream.size, 0).done(function () { var dataReader = Storage.Streams.DataReader.fromBuffer(buffer); var byteArray = new Uint8Array(buffer.length); dataReader.readBytes(byteArray); console.log("Determining emotion"); $.ajax({ url: '/capture/determineEmotion', beforeSend: function (xhrObj) { xhrObj.setRequestHeader('Content-Type', 'application/octet-stream') }, type: 'POST', data: byteArray, processData: false }) .done(function (result) { console.log("successfully determined emotion"); var parsed = JSON.parse(result); if (parsed && parsed.quote && parsed.author) { quoteText.innerText = "\"" + parsed.quote + "\""; quoteAuthor.innerText = "- " + parsed.author; quotePane.style.display = "block"; } else { quotePane.style.display = "none"; } console.log("setting timeout"); setTimeout(function () { checkEmotion = true; quotePane.style.display = "none"; }, 20000); }) .fail(function (e) { console.error(e); checkEmotion = true; quotePane.style.display = "none"; }); }); }); } Authenticate.handleFaces = function(args) {
<<<<<<< t.test('addOverride error with non existing file', function (t) { confit(path.join(__dirname, 'fixtures', 'defaults')) .addOverride('nonexistent.json') .create(function(err, config) { t.ok(err); t.equal(err.code, 'MODULE_NOT_FOUND'); t.end(); }); }); t.test('addOverride error with malformed file', function (t) { confit(path.join(__dirname, 'fixtures', 'defaults')) .addOverride('malformed.json') .create(function(err, config) { t.ok(err); t.equal(err.code, 'MODULE_NOT_FOUND'); t.end(); }); }); t.test('import: with merging objects in imported files', function(t) { console.info('here 1'); var basedir = path.join(__dirname, 'fixtures', 'import'); var factory = confit(basedir); console.info('here 2'); factory.addDefault('override.json'); console.info('came here'); factory.create(function(err, config) { t.error(err); t.ok(config); t.equal(config.get('child:grandchild:secret'), 'santa'); t.equal(config.get('child:grandchild:name'), 'grandchild'); t.equal(config.get('child:grandchild:another'), 'claus'); t.end(); }); }); }); ======= t.test('precedence', function (t) { var factory; var argv = process.argv; var env = process.env; process.argv = [ 'node', __filename, '--override=argv']; process.env = { NODE_ENV: 'development', override: 'env', misc: 'env' }; factory = confit(path.join(__dirname, 'fixtures', 'defaults')); factory.create(function (err, config) { t.error(err); t.ok(config); t.equal(config.get('override'), 'argv'); t.equal(config.get('misc'), 'env'); t.end(); }); t.on('end', function () { process.argv = argv; process.env = env; }); }); }); >>>>>>> t.test('import: with merging objects in imported files', function(t) { var basedir = path.join(__dirname, 'fixtures', 'import'); var factory = confit(basedir); factory.addDefault('override.json'); factory.create(function(err, config) { t.error(err); t.ok(config); t.equal(config.get('child:grandchild:secret'), 'santa'); t.equal(config.get('child:grandchild:name'), 'grandchild'); t.equal(config.get('child:grandchild:another'), 'claus'); t.end(); }); }); t.test('precedence', function (t) { var factory; var argv = process.argv; var env = process.env; process.argv = [ 'node', __filename, '--override=argv']; process.env = { NODE_ENV: 'development', override: 'env', misc: 'env' }; factory = confit(path.join(__dirname, 'fixtures', 'defaults')); factory.create(function (err, config) { t.error(err); t.ok(config); t.equal(config.get('override'), 'argv'); t.equal(config.get('misc'), 'env'); t.end(); }); t.on('end', function () { process.argv = argv; process.env = env; }); }); });
<<<<<<< ======= const asyncForEach = async (_this, array, callback) => { for (let index = 0; index < array.length; index += 1) { await callback(array[index], index, array, _this); } }; const getDifficultyName = zone => { const boss = zone.type === 4 ? 'BOSS - ' : ''; switch (zone.difficulty) { case 3: return `${boss}Hard`; case 2: return `${boss}Medium`; case 1: return `${boss}Low`; default: return `${boss}${zone.difficulty}`; } }; const getScoreForZone = zone => { let score; switch (zone.difficulty) { case 1: score = 5; break; case 2: score = 10; break; case 3: score = 20; break; default: score = 5; break; } return score * 120; }; >>>>>>> const getDifficultyName = zone => { const boss = zone.type === 4 ? 'BOSS - ' : ''; switch (zone.difficulty) { case 3: return `${boss}Hard`; case 2: return `${boss}Medium`; case 1: return `${boss}Low`; default: return `${boss}${zone.difficulty}`; } }; const getScoreForZone = zone => { let score; switch (zone.difficulty) { case 1: score = 5; break; case 2: score = 10; break; case 3: score = 20; break; default: score = 5; break; } return score * 120; }; <<<<<<< throw new SalienScriptException(e.message); ======= if (e.name === 'SalienScriptException' && e.message === 'Boss zone found!') { logger(this.name, chalk.green('>> This planet has a boss zone, selecting this planet')); } else { debug(e); throw new SalienScriptException(e.message); } >>>>>>> throw new SalienScriptException(e.message); <<<<<<< const sortedPlanets = this.knownPlanetIds.sort((a, b) => { ======= if (!this.currentPlanetId) { this.knownPlanetIds.sort((a, b) => { >>>>>>> if (!this.currentPlanetId) { this.knownPlanetIds.sort((a, b) => { <<<<<<< // FIXME this logic might be able to be cleaned up const priorities = ['hardZones', 'mediumZones']; // Loop twice - first loop tries to find planet with hard zones, second loop - medium zones for (let i = 0; i < priorities.length; i += 1) { // eslint-disable-next-line no-loop-func sortedPlanets.forEach(planetId => { ======= for (let i = 0; i < priority.length; i += 1) { this.knownPlanetIds.forEach(planetId => { >>>>>>> for (let i = 0; i < priority.length; i += 1) { this.knownPlanetIds.forEach(planetId => {
<<<<<<< ======= get getPopup() { return _.bind(instance.getPopup, instance); }, >>>>>>> get getPopup() { return _.bind(instance.getPopup, instance); },
<<<<<<< // test offset returns are correct var b = new Buffer(16); assert.equal(4, b.writeUInt32LE(0, 0)); assert.equal(6, b.writeUInt16LE(0, 4)); assert.equal(7, b.writeUInt8(0, 6)); assert.equal(8, b.writeInt8(0, 7)); assert.equal(16, b.writeDoubleLE(0, 8)); ======= // test unmatched surrogates not producing invalid utf8 output // ef bf bd = utf-8 representation of unicode replacement character // see https://codereview.chromium.org/121173009/ buf = new Buffer('ab\ud800cd', 'utf8'); assert.equal(buf[0], 0x61); assert.equal(buf[1], 0x62); assert.equal(buf[2], 0xef); assert.equal(buf[3], 0xbf); assert.equal(buf[4], 0xbd); assert.equal(buf[5], 0x63); assert.equal(buf[6], 0x64); >>>>>>> // test offset returns are correct var b = new Buffer(16); assert.equal(4, b.writeUInt32LE(0, 0)); assert.equal(6, b.writeUInt16LE(0, 4)); assert.equal(7, b.writeUInt8(0, 6)); assert.equal(8, b.writeInt8(0, 7)); assert.equal(16, b.writeDoubleLE(0, 8)); // test unmatched surrogates not producing invalid utf8 output // ef bf bd = utf-8 representation of unicode replacement character // see https://codereview.chromium.org/121173009/ buf = new Buffer('ab\ud800cd', 'utf8'); assert.equal(buf[0], 0x61); assert.equal(buf[1], 0x62); assert.equal(buf[2], 0xef); assert.equal(buf[3], 0xbf); assert.equal(buf[4], 0xbd); assert.equal(buf[5], 0x63); assert.equal(buf[6], 0x64);
<<<<<<< 'http://x:1/\' <>"`/{}|\\^~`/': { protocol: 'http:', slashes: true, host: 'x:1', port: '1', hostname: 'x', pathname: '/%27%20%3C%3E%22%60/%7B%7D%7C%5C%5E~%60/', path: '/%27%20%3C%3E%22%60/%7B%7D%7C%5C%5E~%60/', href: 'http://x:1/%27%20%3C%3E%22%60/%7B%7D%7C%5C%5E~%60/' }, ======= 'http://a@b@c/': { protocol: 'http:', slashes: true, auth: 'a@b', host: 'c', hostname: 'c', href: 'http://a%40b@c/', path: '/', pathname: '/' }, 'http://a@b?@c': { protocol: 'http:', slashes: true, auth: 'a', host: 'b', hostname: 'b', href: 'http://a@b/?@c', path: '/?@c', pathname: '/', search: '?@c', query: '@c' }, 'http://a\r" \t\n<\'b:b@c\r\nd/e?f':{ protocol: 'http:', slashes: true, auth: 'a\r" \t\n<\'b:b', host: 'c', port: null, hostname: 'c', hash: null, search: '?f', query: 'f', pathname: '%0D%0Ad/e', path: '%0D%0Ad/e?f', href: 'http://a%0D%22%20%09%0A%3C\'b:b@c/%0D%0Ad/e?f' } >>>>>>> 'http://x:1/\' <>"`/{}|\\^~`/': { protocol: 'http:', slashes: true, host: 'x:1', port: '1', hostname: 'x', pathname: '/%27%20%3C%3E%22%60/%7B%7D%7C%5C%5E~%60/', path: '/%27%20%3C%3E%22%60/%7B%7D%7C%5C%5E~%60/', href: 'http://x:1/%27%20%3C%3E%22%60/%7B%7D%7C%5C%5E~%60/' }, 'http://a@b@c/': { protocol: 'http:', slashes: true, auth: 'a@b', host: 'c', hostname: 'c', href: 'http://a%40b@c/', path: '/', pathname: '/' }, 'http://a@b?@c': { protocol: 'http:', slashes: true, auth: 'a', host: 'b', hostname: 'b', href: 'http://a@b/?@c', path: '/?@c', pathname: '/', search: '?@c', query: '@c' }, 'http://a\r" \t\n<\'b:b@c\r\nd/e?f':{ protocol: 'http:', slashes: true, auth: 'a\r" \t\n<\'b:b', host: 'c', port: null, hostname: 'c', hash: null, search: '?f', query: 'f', pathname: '%0D%0Ad/e', path: '%0D%0Ad/e?f', href: 'http://a%0D%22%20%09%0A%3C\'b:b@c/%0D%0Ad/e?f' }
<<<<<<< if (!util.isBuffer(chunk) && !util.isString(chunk) && !util.isNullOrUndefined(chunk) && !state.objectMode && !er) { ======= if (!Buffer.isBuffer(chunk) && 'string' !== typeof chunk && chunk !== null && chunk !== undefined && !state.objectMode) { >>>>>>> if (!util.isBuffer(chunk) && !util.isString(chunk) && !util.isNullOrUndefined(chunk) && !state.objectMode) {
<<<<<<< next(); } ======= if (stats) next(stats); else _next(); } exports.realpathSync = function(path) { var stats = exports.lstatSync(path); if (stats.isSymbolicLink()) return readlinkDeepSync(path, stats); else return normalize(path); } exports.realpath = function(path, callback) { var resolved_path = path; if (!callback) return; exports.lstat(path, function(err, stats){ if (err) callback(err); else if (stats.isSymbolicLink()) readlinkDeep(path, stats, callback); else callback(null, normalize(path)); }); } exports.createReadStream = function(path, options) { return new FileReadStream(path, options); }; var FileReadStream = exports.FileReadStream = function(path, options) { events.EventEmitter.call(this); this.path = path; this.fd = null; this.readable = true; this.paused = false; this.flags = 'r'; this.encoding = 'binary'; this.mode = 0666; this.bufferSize = 4 * 1024; process.mixin(this, options || {}); var self = this, buffer = null; function read() { if (!self.readable || self.paused) { return; } fs.read(self.fd, self.bufferSize, undefined, self.encoding, function(err, data, bytesRead) { if (err) { self.emit('error', err); self.readable = false; return; } if (bytesRead === 0) { self.emit('end'); self.forceClose(); return; } // do not emit events if the stream is paused if (self.paused) { buffer = data; return; } // do not emit events anymore after we declared the stream unreadable if (!self.readable) { return; } self.emit('data', data); read(); }); } fs.open(this.path, this.flags, this.mode, function(err, fd) { if (err) { self.emit('error', err); self.readable = false; return; } self.fd = fd; self.emit('open', fd); read(); }); this.forceClose = function() { this.readable = false; fs.close(this.fd, function(err) { if (err) { self.emit('error', err); return; } self.emit('close'); }); }; this.pause = function() { this.paused = true; }; this.resume = function() { this.paused = false; if (buffer !== null) { self.emit('data', buffer); buffer = null; } read(); }; }; sys.inherits(FileReadStream, events.EventEmitter); exports.createWriteStream = function(path, options) { return new FileWriteStream(path, options); }; var FileWriteStream = exports.FileWriteStream = function(path, options) { events.EventEmitter.call(this); this.path = path; this.fd = null; this.writeable = true; this.flags = 'w'; this.encoding = 'binary'; this.mode = 0666; process.mixin(this, options || {}); var self = this, queue = [], busy = false; queue.push([fs.open, this.path, this.flags, this.mode]); function flush() { if (busy) { return; } var args = queue.shift(); if (!args) { return self.emit('drain'); } busy = true; var method = args.shift(); args.push(function(err) { busy = false; if (err) { self.writeable = false; self.emit('error', err); return; } // save reference for file pointer if (method === fs.open) { self.fd = arguments[1]; self.emit('open', self.fd); } // stop flushing after close if (method === fs.close) { self.emit('close'); return; } flush(); }); // Inject the file pointer if (method !== fs.open) { args.unshift(self.fd); } method.apply(null, args); }; this.write = function(data) { if (!this.writeable) { throw new Error('stream not writeable'); } queue.push([fs.write, data, undefined, this.encoding]); flush(); return false; }; this.close = function() { this.writeable = false; queue.push([fs.close,]); flush(); }; this.forceClose = function() { this.writeable = false; fs.close(self.fd, function(err) { if (err) { self.emit('error', err); return; } self.emit('close'); }); }; flush(); }; sys.inherits(FileWriteStream, events.EventEmitter); >>>>>>> next(); } exports.createReadStream = function(path, options) { return new FileReadStream(path, options); }; var FileReadStream = exports.FileReadStream = function(path, options) { events.EventEmitter.call(this); this.path = path; this.fd = null; this.readable = true; this.paused = false; this.flags = 'r'; this.encoding = 'binary'; this.mode = 0666; this.bufferSize = 4 * 1024; process.mixin(this, options || {}); var self = this, buffer = null; function read() { if (!self.readable || self.paused) { return; } fs.read(self.fd, self.bufferSize, undefined, self.encoding, function(err, data, bytesRead) { if (err) { self.emit('error', err); self.readable = false; return; } if (bytesRead === 0) { self.emit('end'); self.forceClose(); return; } // do not emit events if the stream is paused if (self.paused) { buffer = data; return; } // do not emit events anymore after we declared the stream unreadable if (!self.readable) { return; } self.emit('data', data); read(); }); } fs.open(this.path, this.flags, this.mode, function(err, fd) { if (err) { self.emit('error', err); self.readable = false; return; } self.fd = fd; self.emit('open', fd); read(); }); this.forceClose = function() { this.readable = false; fs.close(this.fd, function(err) { if (err) { self.emit('error', err); return; } self.emit('close'); }); }; this.pause = function() { this.paused = true; }; this.resume = function() { this.paused = false; if (buffer !== null) { self.emit('data', buffer); buffer = null; } read(); }; }; sys.inherits(FileReadStream, events.EventEmitter); exports.createWriteStream = function(path, options) { return new FileWriteStream(path, options); }; var FileWriteStream = exports.FileWriteStream = function(path, options) { events.EventEmitter.call(this); this.path = path; this.fd = null; this.writeable = true; this.flags = 'w'; this.encoding = 'binary'; this.mode = 0666; process.mixin(this, options || {}); var self = this, queue = [], busy = false; queue.push([fs.open, this.path, this.flags, this.mode]); function flush() { if (busy) { return; } var args = queue.shift(); if (!args) { return self.emit('drain'); } busy = true; var method = args.shift(); args.push(function(err) { busy = false; if (err) { self.writeable = false; self.emit('error', err); return; } // save reference for file pointer if (method === fs.open) { self.fd = arguments[1]; self.emit('open', self.fd); } // stop flushing after close if (method === fs.close) { self.emit('close'); return; } flush(); }); // Inject the file pointer if (method !== fs.open) { args.unshift(self.fd); } method.apply(null, args); }; this.write = function(data) { if (!this.writeable) { throw new Error('stream not writeable'); } queue.push([fs.write, data, undefined, this.encoding]); flush(); return false; }; this.close = function() { this.writeable = false; queue.push([fs.close,]); flush(); }; this.forceClose = function() { this.writeable = false; fs.close(self.fd, function(err) { if (err) { self.emit('error', err); return; } self.emit('close'); }); }; flush(); }; sys.inherits(FileWriteStream, events.EventEmitter);