conflict_resolution
stringlengths
27
16k
<<<<<<< var crypto = require('crypto'); module.exports = function(UserService, models) { return (require('./../classes/Controller.js')).extend( { requiresLogin: function(req, res, next) { if (!req.session.user) return res.send(401); next(); }, requiresRole: function(roleName) { return function(req, res, next) { if (!req.session.user || !req.session.user.roles || req.session.user.roles.indexOf(roleName) === -1) return res.send(401); next(); }; } }, { listAction: function() { UserService.findAll() .then(this.proxy('send')) .fail(this.proxy('handleException')); }, getAction: function() { UserService.findById(this.req.params.id) .then(this.proxy('send')) .fail(this.proxy('handleException')); }, postAction: function() { UserService.create(this.req.body) .then(this.proxy('send')) .fail(this.proxy('handleException')); }, putAction: function() { UserService.update(this.req.body) .then(this.proxy('send')) .fail(this.proxy('handleException')); }, loginAction: function() { var credentials = { username: this.req.body.username, password: crypto.createHash('sha1').update(this.req.body.password).digest('hex') } UserService.authenticate(credentials) .then(this.proxy('authorizedUser')) .fail(this.proxy('handleException')); }, authorizedUser: function(user) { console.dir(user); if (user) { this.req.session.user = user; this.res.send(200); } else { this.res.send(403); } }, logoutAction: function() { this.req.session.user = null; this.res.send(200); } }); ======= var crypto = require('crypto') , passport = require('passport') , LocalStrategy = require('passport-local').Strategy; module.exports = function(UserService, ReservationService, ClientService, TrainerModel) { passport.serializeUser(function (user, done) { done(null, user.id); }); passport.deserializeUser(function (id, done) { UserService.findById(id) .then(done.bind(null, null)) .fail(done); }); passport.use(new LocalStrategy(function (username, password, done) { var credentials = { username: username, password: crypto.createHash('sha1').update(password).digest('hex') }; UserService.authenticate(credentials) .then(done.bind(null, null)) .fail(done); })); return (require('./../classes/Controller.js')).extend( { service: UserService, requiresLogin: function(req, res, next) { if (!req.isAuthenticated()) return res.send(401); next(); }, requiresRole: function(roleName) { return function(req, res, next) { if (!req.isAuthenticated() || !req.session.user.roles || req.session.user.roles.indexOf(roleName) === -1) return res.send(401); next(); }; } }, { postAction: function() { var self = this; var data = self.req.body; if (data.id) { return self.putAction(); } if (data.password) { data.password = crypto.createHash('sha1').update(data.password).digest('hex'); } UserService .create(data) .then(this.proxy('send')) .fail(self.proxy('handleException')); }, putAction: function() { var user = this.req.user; var data = this.req.body; if ( data.password ) { data.password = crypto.createHash('sha1').update(data.password).digest('hex'); } if ( data.new_password ) { UserService.find({ where: { id: data.id, password: data.password } }) .then( this.proxy( 'handleUpdatePassword', data.new_password ) ) .fail( this.proxy( 'handleException' ) ); } else { UserService .update(user, data) .then(this.proxy('send')) .fail(this.proxy('handleException')); } }, handleUpdatePassword: function ( newPassword, user ) { if (user.length) { user = user[0]; user.updateAttributes({ password: crypto.createHash('sha1').update(newPassword).digest('hex') }).success(function (user) { this.send({status: 200, results: user}); }.bind(this) ).fail(this.proxy('handleException')); } else { this.send({status: 500, error: "Incorrect old password!"}); } }, loginAction: function() { passport.authenticate('local', this.proxy('handleLocalUser'))(this.req, this.res, this.next); }, handleLocalUser: function (err, user) { if (err) return this.handleException(err); if (!user) return this.send(403); this.loginUserJson(user); }, loginUserJson: function (user) { this.req.login(user, this.proxy('handleLoginJson', user)); }, handleLoginJson: function (user, err) { if (err) return this.handleException(err); this.send(user); }, currentAction: function () { var user = this.req.user; if (!user) { return this.send({}); } this.send(user); }, authorizedUser: function(user) { console.dir(user); if (user) { this.req.login(user); this.res.send(200); } else { this.res.send(403); } }, logoutAction: function() { this.req.logout(); this.res.send(200); } }); >>>>>>> var crypto = require('crypto') , passport = require('passport') , LocalStrategy = require('passport-local').Strategy; module.exports = function(UserService) { passport.serializeUser(function (user, done) { done(null, user.id); }); passport.deserializeUser(function (id, done) { UserService.findById(id) .then(done.bind(null, null)) .fail(done); }); passport.use(new LocalStrategy(function (username, password, done) { var credentials = { username: username, password: crypto.createHash('sha1').update(password).digest('hex') }; UserService.authenticate(credentials) .then(done.bind(null, null)) .fail(done); })); return (require('./../classes/Controller.js')).extend( { service: UserService, requiresLogin: function(req, res, next) { if (!req.isAuthenticated()) return res.send(401); next(); }, requiresRole: function(roleName) { return function(req, res, next) { if (!req.isAuthenticated() || !req.session.user.roles || req.session.user.roles.indexOf(roleName) === -1) return res.send(401); next(); }; } }, { postAction: function() { var self = this; var data = self.req.body; if (data.id) { return self.putAction(); } if (data.password) { data.password = crypto.createHash('sha1').update(data.password).digest('hex'); } UserService .create(data) .then(this.proxy('send')) .fail(self.proxy('handleException')); }, putAction: function() { var user = this.req.user; var data = this.req.body; if ( data.password ) { data.password = crypto.createHash('sha1').update(data.password).digest('hex'); } if ( data.new_password ) { UserService.find({ where: { id: data.id, password: data.password } }) .then( this.proxy( 'handleUpdatePassword', data.new_password ) ) .fail( this.proxy( 'handleException' ) ); } else { UserService .update(user, data) .then(this.proxy('send')) .fail(this.proxy('handleException')); } }, handleUpdatePassword: function ( newPassword, user ) { if (user.length) { user = user[0]; user.updateAttributes({ password: crypto.createHash('sha1').update(newPassword).digest('hex') }).success(function (user) { this.send({status: 200, results: user}); }.bind(this) ).fail(this.proxy('handleException')); } else { this.send({status: 500, error: "Incorrect old password!"}); } }, loginAction: function() { passport.authenticate('local', this.proxy('handleLocalUser'))(this.req, this.res, this.next); }, handleLocalUser: function (err, user) { if (err) return this.handleException(err); if (!user) return this.send(403); this.loginUserJson(user); }, loginUserJson: function (user) { this.req.login(user, this.proxy('handleLoginJson', user)); }, handleLoginJson: function (user, err) { if (err) return this.handleException(err); this.send(user); }, currentAction: function () { var user = this.req.user; if (!user) { return this.send({}); } this.send(user); }, authorizedUser: function(user) { console.dir(user); if (user) { this.req.login(user); this.res.send(200); } else { this.res.send(403); } }, logoutAction: function() { this.req.logout(); this.res.send(200); } });
<<<<<<< const {users, currentOrganization, meRole, me} = this.props ======= const {users, meCurrentOrganization, meRole, meID} = this.props >>>>>>> const {users, meCurrentOrganization, meRole, meID} = this.props <<<<<<< me: shape({ name: string.isRequired, id: string.isRequired, }).isRequired, ======= meID: string.isRequired, >>>>>>> me: shape({ name: string.isRequired, id: string.isRequired, }).isRequired, meID: string.isRequired, <<<<<<< auth: {me, me: {currentOrganization, role: meRole}}, ======= auth: { me: {currentOrganization: meCurrentOrganization, role: meRole, id: meID}, }, >>>>>>> auth: { me, me: {currentOrganization: meCurrentOrganization, role: meRole, id: meID}, }, <<<<<<< me, ======= meID, >>>>>>> me, meID,
<<<<<<< className="dygraph-annotation-window" style={annotationWindowStyle(annotation, dygraph, staticLegendHeight)} ======= className="annotation-window" style={windowDimensions(annotation, dygraph)} >>>>>>> className="annotation-window" style={windowDimensions(annotation, dygraph, staticLegendHeight)} <<<<<<< const {number, shape, string} = PropTypes ======= const {shape} = PropTypes >>>>>>> const {number, shape} = PropTypes
<<<<<<< <div className="page-contents"> <div className="tickscript-console"> <div className="tickscript-console--output"> {validation ? <p> {validation} </p> : <p className="tickscript-console--default"> Save your TICKscript to validate it </p>} </div> </div> <div className="tickscript-editor"> <div> {logs.map(({key, ts, lvl, msg}) => <div key={key}> <span> {ts} </span> <span> {lvl} </span> <pre> {msg} </pre> </div> )} </div> ======= <div className="page-contents--split"> <div className="tickscript"> <TickscriptEditorControls isNewTickscript={isNewTickscript} onSelectDbrps={onSelectDbrps} onChangeType={onChangeType} onChangeID={onChangeID} task={task} /> <TickscriptEditorConsole validation={validation} /> >>>>>>> <div className="page-contents--split"> <div className="tickscript"> <TickscriptEditorControls isNewTickscript={isNewTickscript} onSelectDbrps={onSelectDbrps} onChangeType={onChangeType} onChangeID={onChangeID} task={task} /> <TickscriptEditorConsole validation={validation} /> <<<<<<< source: shape({ id: string, }), ======= areLogsVisible: bool, onToggleLogsVisbility: func.isRequired, >>>>>>> source: shape({ id: string, }), areLogsVisible: bool, onToggleLogsVisbility: func.isRequired,
<<<<<<< ? <NavBlock icon="user" className="sidebar__square-last"> <NavHeader link={logoutLink} title="Logout" /> ======= ? <NavBlock icon="user-outline" className="sidebar__square-last"> <NavHeader useAnchor={true} link={logoutLink} title="Logout" /> >>>>>>> ? <NavBlock icon="user" className="sidebar__square-last"> <NavHeader useAnchor={true} link={logoutLink} title="Logout" />
<<<<<<< const containerLeftPadding = 16 const windowDimensions = (anno, dygraph, staticLegendHeight) => { ======= const windowDimensions = (anno, dygraph) => { >>>>>>> const windowDimensions = (anno, dygraph, staticLegendHeight) => { <<<<<<< left, width, height, ======= left: `${windowLeftXCoord}px`, width: `${windowWidth}px`, >>>>>>> left: `${windowLeftXCoord}px`, width: `${windowWidth}px`, height,
<<<<<<< const {tableOptions} = this.props const timeFormat = tableOptions ? tableOptions.timeFormat : 'MM/DD/YYYY HH:mm:ss.ss' const isTimeCell = columnIndex === 0 && rowIndex > 0 ======= >>>>>>> const {tableOptions} = this.props const timeFormat = tableOptions ? tableOptions.timeFormat : 'MM/DD/YYYY HH:mm:ss.ss' <<<<<<< <div key={key} className={cellClass} style={style}> {isTimeCell ? moment(data[rowIndex][columnIndex]).format(timeFormat) : data[rowIndex][columnIndex]} ======= <div key={key} style={style} className={cellClass} onMouseOver={this.handleHover(columnIndex, rowIndex)} > {`${data[rowIndex][columnIndex]}`} >>>>>>> <div key={key} style={style} className={cellClass} onMouseOver={this.handleHover(columnIndex, rowIndex)} > {isFixedColumn ? `${moment(data[rowIndex][columnIndex].toISOString()).format( timeFormat )}` : `${data[rowIndex][columnIndex]}`} <<<<<<< const {tableOptions} = this.props ======= const {hoveredColumnIndex, hoveredRowIndex} = this.state const {hoverTime} = this.props >>>>>>> const {hoveredColumnIndex, hoveredRowIndex} = this.state const {hoverTime, tableOptions} = this.props <<<<<<< timeFormat={ tableOptions ? tableOptions.timeFormat : 'MM/DD/YYYY HH:mm:ss.ss' } ======= scrollToRow={hoverTimeRow} cellRenderer={this.cellRenderer} hoveredColumnIndex={hoveredColumnIndex} hoveredRowIndex={hoveredRowIndex} hoverTime={hoverTime} >>>>>>> timeFormat={ tableOptions ? tableOptions.timeFormat : 'MM/DD/YYYY HH:mm:ss.ss' } scrollToRow={hoverTimeRow} cellRenderer={this.cellRenderer} hoveredColumnIndex={hoveredColumnIndex} hoveredRowIndex={hoveredRowIndex} hoverTime={hoverTime} <<<<<<< tableOptions: shape({}), ======= hoverTime: string, onSetHoverTime: func, >>>>>>> tableOptions: shape({}), hoverTime: string, onSetHoverTime: func,
<<<<<<< render() { const { dygraph, isTempHovering, tempAnnotation: {time}, staticLegendHeight, } = this.props const {isMouseOver, mouseAction} = this.state ======= renderTimestamp(time) { >>>>>>> renderTimestamp(time) { <<<<<<< <div className={classnames('new-annotation', {hover: isTempHovering})} ref={el => (this.wrapper = el)} onMouseMove={this.handleMouseMove} onMouseOver={this.handleMouseOver} onMouseLeave={this.handleMouseLeave} onMouseUp={this.handleMouseUp} onMouseDown={this.handleMouseDown} style={newAnnotationContainer(staticLegendHeight)} > ======= <div> >>>>>>> <div> <<<<<<< const {bool, func, number, shape} = PropTypes ======= const {bool, func, shape, string} = PropTypes NewAnnotation.contextTypes = { source: shape({ links: shape({ annotations: string, }), }), } >>>>>>> const {bool, func, number, shape, string} = PropTypes NewAnnotation.contextTypes = { source: shape({ links: shape({ annotations: string, }), }), }
<<<<<<< ======= cellRenderer = ({columnIndex, rowIndex, key, parent, style}) => { const {hoveredColumnIndex, hoveredRowIndex} = this.state const {tableOptions, colors} = this.props const verticalTimeAxis = _.get(tableOptions, 'verticalTimeAxis', true) const data = verticalTimeAxis ? this.state.data : this.state.unzippedData const columnCount = _.get(data, ['0', 'length'], 0) const rowCount = data.length >>>>>>> cellRenderer = ({columnIndex, rowIndex, key, parent, style}) => { const {hoveredColumnIndex, hoveredRowIndex} = this.state const {tableOptions, colors} = this.props const verticalTimeAxis = _.get(tableOptions, 'verticalTimeAxis', true) const data = verticalTimeAxis ? this.state.data : this.state.unzippedData <<<<<<< > {({getColumnWidth, registerChild}) => <MultiGrid ref={registerChild} columnCount={columnCount} columnWidth={getColumnWidth} rowCount={rowCount} rowHeight={ROW_HEIGHT} height={tableHeight} width={tableWidth} fixedColumnCount={fixedColumnCount} fixedRowCount={1} enableFixedColumnScroll={true} enableFixedRowScroll={true} timeFormat={ tableOptions ? tableOptions.timeFormat : TIME_FORMAT_DEFAULT } columnNames={ tableOptions ? tableOptions.columnNames : [TIME_COLUMN_DEFAULT] } scrollToRow={scrollToRow} scrollToColumn={scrollToColumn} verticalTimeAxis={verticalTimeAxis} sortByColumnIndex={sortByColumnIndex} cellRenderer={this.cellRenderer} hoveredColumnIndex={hoveredColumnIndex} hoveredRowIndex={hoveredRowIndex} hoverTime={hoverTime} colors={colors} classNameBottomRightGrid="table-graph--scroll-window" />} </ColumnSizer>} ======= fixedColumnCount={fixedColumnCount} fixedRowCount={1} enableFixedColumnScroll={true} enableFixedRowScroll={true} timeFormat={ tableOptions ? tableOptions.timeFormat : TIME_FORMAT_DEFAULT } columnNames={ tableOptions ? tableOptions.columnNames : [TIME_COLUMN_DEFAULT] } scrollToRow={scrollToRow} scrollToColumn={scrollToColumn} verticalTimeAxis={verticalTimeAxis} sortByColumnIndex={sortByColumnIndex} clickToSortFieldIndex={clickToSortFieldIndex} clicktoSortDirection={clicktoSortDirection} cellRenderer={this.cellRenderer} hoveredColumnIndex={hoveredColumnIndex} hoveredRowIndex={hoveredRowIndex} hoverTime={hoverTime} colors={colors} />} >>>>>>> > {({getColumnWidth, registerChild}) => <MultiGrid ref={registerChild} columnCount={columnCount} columnWidth={getColumnWidth} rowCount={rowCount} rowHeight={ROW_HEIGHT} height={tableHeight} width={tableWidth} fixedColumnCount={fixedColumnCount} fixedRowCount={1} enableFixedColumnScroll={true} enableFixedRowScroll={true} timeFormat={ tableOptions ? tableOptions.timeFormat : TIME_FORMAT_DEFAULT } columnNames={ tableOptions ? tableOptions.columnNames : [TIME_COLUMN_DEFAULT] } scrollToRow={scrollToRow} scrollToColumn={scrollToColumn} verticalTimeAxis={verticalTimeAxis} sortByColumnIndex={sortByColumnIndex} clickToSortFieldIndex={clickToSortFieldIndex} clicktoSortDirection={clicktoSortDirection} cellRenderer={this.cellRenderer} hoveredColumnIndex={hoveredColumnIndex} hoveredRowIndex={hoveredRowIndex} hoverTime={hoverTime} colors={colors} classNameBottomRightGrid="table-graph--scroll-window" />} </ColumnSizer>}
<<<<<<< import {timeSeriesToTableGraph} from 'src/utils/timeSeriesToDygraph' ======= import classnames from 'classnames' import {timeSeriesToTable} from 'src/utils/timeSeriesToDygraph' >>>>>>> import classnames from 'classnames' import {timeSeriesToTableGraph} from 'src/utils/timeSeriesToDygraph' <<<<<<< width={tableWidth - 32} hoveredColumnIndex={this.state.hoveredColumnIndex} hoveredRowIndex={this.state.hoveredRowIndex} hoverTime={this.props.hoverTime} ======= width={tableWidth} enableFixedColumnScroll={true} enableFixedRowScroll={true} >>>>>>> enableFixedColumnScroll={true} enableFixedRowScroll={true} hoveredColumnIndex={this.state.hoveredColumnIndex} hoveredRowIndex={this.state.hoveredRowIndex} hoverTime={hoverTime} width={tableWidth}
<<<<<<< setResolution: func, ======= cellHeight: number, >>>>>>> setResolution: func, cellHeight: number,
<<<<<<< onInit = (...args) => { if (this.props.debug) { this.setupDebugRenderer(); } this.props.onInit(...args); }; stopDebugRendering = () => { if (this._render) { Render.stop(this._render); delete this._render; } }; getDebugProps = () => { const debugProps = Object.assign( { offset: {}, // transparent background to see sprites, etc, in the world background: 'rgba(0, 0, 0, 0)', }, this.props.debug || {} ); debugProps.offset = Object.assign( { x: 0, y: 0, }, debugProps.offset ); return debugProps; }; setupDebugRenderer = () => { if (!this._debugRenderElement) { return; } const { renderWidth, renderHeight, scale } = this.context; const { offset, background } = this.getDebugProps(); const width = renderWidth / scale; const height = renderHeight / scale; this._render = Render.create({ canvas: this._debugRenderElement, // Auto-zoom the canvas to the correct game area bounds: { min: { x: offset.x, y: offset.y, }, max: { x: offset.x + width, y: offset.y + height, }, }, options: { wireframeBackground: background, width: renderWidth, height: renderHeight, }, }); // Setting this as part of `.create` crashes Chrome during a deep clone. :/ // My guess: a circular reference this._render.engine = this.engine; Render.run(this._render); }; getCanvasRef = element => { this._debugRenderElement = element; if (element) { if (!this._render) { this.setupDebugRenderer(); } } else { this.stopDebugRendering(); } }; ======= >>>>>>> <<<<<<< if (!nextProps.debug) { this.stopDebugRendering(); } } componentDidUpdate() { if (this.props.debug && this._render) { const { renderWidth, renderHeight, scale } = this.context; const { offset } = this.getDebugProps(); // When context changes (eg; `scale` due to a window resize), // re-calculate the world stage this._render.options.width = renderWidth; this._render.options.height = renderHeight; this._render.bounds = { min: { x: offset.x, y: offset.y, }, max: { x: offset.x + renderWidth / scale, y: offset.y + renderHeight / scale, }, }; Render.world(this._render); } ======= >>>>>>>
<<<<<<< Matter.Events.on(engine, 'afterUpdate', this.update); this.unsubscribeFromUpdate = () => { Matter.Events.off(engine, 'afterUpdate', this.update); }; }; ======= } >>>>>>> }; <<<<<<< update = () => { // On first press of "d", enable debug mode if (this.keyListener.isDown(KEY_D)) { if (!this.previousDown) { this.previousDown = true; this.setState({ debug: !this.state.debug }); } } else { this.previousDown = false; } }; ======= >>>>>>> <<<<<<< this.stageXUIUnsubscribe = GameStore.onStageXChange(stageX => { this.forceUpdate(); }); ======= >>>>>>>
<<<<<<< const fifteenMinutes = Date.now() - 15 * 60 * 1000 getAnnotationsAsync(source.links.annotations, fifteenMinutes) ======= window.addEventListener('resize', this.handleWindowResize, true) >>>>>>> const fifteenMinutes = Date.now() - 15 * 60 * 1000 getAnnotationsAsync(source.links.annotations, fifteenMinutes) window.addEventListener('resize', this.handleWindowResize, true)
<<<<<<< onSetHoverTime, hoverTime, queryASTs, onNewQueryAST, ======= >>>>>>> queryASTs, onNewQueryAST,
<<<<<<< import React, {PropTypes, Component} from 'react' import SlideToggle from 'shared/components/SlideToggle' ======= import React, {PropTypes, Component} from 'react' >>>>>>> import React, {PropTypes, Component} from 'react' import SlideToggle from 'shared/components/SlideToggle' <<<<<<< class OrganizationsTableRowDefault extends Component { toggleWhitelistOnly = () => { const {organization, onToggleWhitelistOnly} = this.props onToggleWhitelistOnly(organization) } render() { const {organization} = this.props return ( <div className="orgs-table--org"> <div className="orgs-table--id"> {organization.id} </div> <div className="orgs-table--name-disabled"> {organization.name} </div> <div className="orgs-table--whitelist"> <SlideToggle size="xs" active={organization.whitelistOnly} onToggle={this.toggleWhitelistOnly} /> </div> <div className="orgs-table--default-role-disabled"> {MEMBER_ROLE} </div> <button className="btn btn-sm btn-default btn-square orgs-table--delete" disabled={true} > <span className="icon trash" /> </button> </div> ) } } const {func, shape, string} = PropTypes ======= class OrganizationsTableRowDefault extends Component { handleChooseDefaultRole = role => { const {organization, onChooseDefaultRole} = this.props onChooseDefaultRole(organization, role.name) } render() { const {organization} = this.props const dropdownRolesItems = USER_ROLES.map(role => ({ ...role, text: role.name, })) return ( <div className="orgs-table--org"> <div className="orgs-table--id"> {organization.id} </div> <div className="orgs-table--name-disabled"> {organization.name} </div> <div className="orgs-table--default-role"> <Dropdown items={dropdownRolesItems} onChoose={this.handleChooseDefaultRole} selected={organization.defaultRole} className="dropdown-stretch" /> </div> <button className="btn btn-sm btn-default btn-square orgs-table--delete" disabled={true} > <span className="icon trash" /> </button> </div> ) } } const {func, shape, string} = PropTypes >>>>>>> class OrganizationsTableRowDefault extends Component { toggleWhitelistOnly = () => { const {organization, onToggleWhitelistOnly} = this.props onToggleWhitelistOnly(organization) } handleChooseDefaultRole = role => { const {organization, onChooseDefaultRole} = this.props onChooseDefaultRole(organization, role.name) } render() { const {organization} = this.props const dropdownRolesItems = USER_ROLES.map(role => ({ ...role, text: role.name, })) return ( <div className="orgs-table--org"> <div className="orgs-table--id"> {organization.id} </div> <div className="orgs-table--name-disabled"> {organization.name} </div> <div className="orgs-table--whitelist"> <SlideToggle size="xs" active={organization.whitelistOnly} onToggle={this.toggleWhitelistOnly} /> </div> <div className="orgs-table--default-role"> <Dropdown items={dropdownRolesItems} onChoose={this.handleChooseDefaultRole} selected={organization.defaultRole} className="dropdown-stretch" /> </div> <button className="btn btn-sm btn-default btn-square orgs-table--delete" disabled={true} > <span className="icon trash" /> </button> </div> ) } } const {func, shape, string} = PropTypes <<<<<<< onToggleWhitelistOnly: func.isRequired, ======= onChooseDefaultRole: func.isRequired, >>>>>>> onToggleWhitelistOnly: func.isRequired, onChooseDefaultRole: func.isRequired,
<<<<<<< <div className="col-xs-12"> <AdminTabs meRole={meRole} // UsersTable users={users} organization={currentOrganization} onCreateUser={this.handleCreateUser} onUpdateUserRole={this.handleUpdateUserRole} onUpdateUserSuperAdmin={this.handleUpdateUserSuperAdmin} onDeleteUser={this.handleDeleteUser} /> </div> ======= <AdminTabs meRole={meRole} // UsersTable users={users} organization={currentOrganization} onCreateUser={this.handleCreateUser} onUpdateUserRole={this.handleUpdateUserRole()} onUpdateUserSuperAdmin={this.handleUpdateUserSuperAdmin()} onDeleteUser={this.handleDeleteUser()} /> >>>>>>> <AdminTabs meRole={meRole} // UsersTable users={users} organization={currentOrganization} onCreateUser={this.handleCreateUser} onUpdateUserRole={this.handleUpdateUserRole} onUpdateUserSuperAdmin={this.handleUpdateUserSuperAdmin} onDeleteUser={this.handleDeleteUser} />
<<<<<<< {isTimeData ? `${moment(cellData).format(timeFormat)}` : fieldName || `${cellData}`} ======= {cellContents} >>>>>>> {cellContents} <<<<<<< {!_.isEmpty(data) && <MultiGrid ======= {!isEmpty(data) && <ColumnSizer >>>>>>> {!_.isEmpty(data) && <ColumnSizer <<<<<<< fixedColumnCount={fixedColumnCount} fixedRowCount={1} enableFixedColumnScroll={true} enableFixedRowScroll={true} timeFormat={ tableOptions ? tableOptions.timeFormat : TIME_FORMAT_DEFAULT } fieldNames={ tableOptions ? tableOptions.fieldNames : [TIME_FIELD_DEFAULT] } scrollToRow={scrollToRow} scrollToColumn={scrollToColumn} verticalTimeAxis={verticalTimeAxis} sortField={sortField} sortDirection={sortDirection} cellRenderer={this.cellRenderer} hoveredColumnIndex={hoveredColumnIndex} hoveredRowIndex={hoveredRowIndex} hoverTime={hoverTime} colors={colors} />} ======= > {({getColumnWidth, registerChild}) => <MultiGrid ref={registerChild} columnCount={columnCount} columnWidth={getColumnWidth} rowCount={rowCount} rowHeight={ROW_HEIGHT} height={tableHeight} width={tableWidth} fixedColumnCount={fixedColumnCount} fixedRowCount={1} enableFixedColumnScroll={true} enableFixedRowScroll={true} timeFormat={ tableOptions ? tableOptions.timeFormat : TIME_FORMAT_DEFAULT } columnNames={ tableOptions ? tableOptions.columnNames : [TIME_COLUMN_DEFAULT] } scrollToRow={scrollToRow} scrollToColumn={scrollToColumn} verticalTimeAxis={verticalTimeAxis} sortByColumnIndex={sortByColumnIndex} clickToSortFieldIndex={clickToSortFieldIndex} clicktoSortDirection={clicktoSortDirection} cellRenderer={this.cellRenderer} hoveredColumnIndex={hoveredColumnIndex} hoveredRowIndex={hoveredRowIndex} hoverTime={hoverTime} colors={colors} classNameBottomRightGrid="table-graph--scroll-window" />} </ColumnSizer>} >>>>>>> > {({getColumnWidth, registerChild}) => <MultiGrid ref={registerChild} columnCount={columnCount} columnWidth={getColumnWidth} rowCount={rowCount} rowHeight={ROW_HEIGHT} height={tableHeight} width={tableWidth} fixedColumnCount={fixedColumnCount} fixedRowCount={1} enableFixedColumnScroll={true} enableFixedRowScroll={true} timeFormat={ tableOptions ? tableOptions.timeFormat : TIME_FORMAT_DEFAULT } fieldNames={ tableOptions ? tableOptions.fieldNames : [TIME_FIELD_DEFAULT] } scrollToRow={scrollToRow} scrollToColumn={scrollToColumn} verticalTimeAxis={verticalTimeAxis} sortField={sortField} sortDirection={sortDirection} cellRenderer={this.cellRenderer} hoveredColumnIndex={hoveredColumnIndex} hoveredRowIndex={hoveredRowIndex} hoverTime={hoverTime} colors={colors} classNameBottomRightGrid="table-graph--scroll-window" />} </ColumnSizer>}
<<<<<<< export class HostsPage extends Component { ======= @ErrorHandling class HostsPage extends Component { >>>>>>> @ErrorHandling export class HostsPage extends Component {
<<<<<<< const DeleteButton = ({onClickDelete, buttonSize, text, disabled}) => ======= const DeleteButton = ({onClickDelete, buttonSize, icon, square}) => >>>>>>> const DeleteButton = ({ onClickDelete, buttonSize, icon, square, text, disabled, }) => <<<<<<< disabled, ======= 'btn-square': square, >>>>>>> 'btn-square': square, disabled, <<<<<<< {text} ======= {icon ? <span className={`icon ${icon}`} /> : 'Delete'} >>>>>>> {icon ? <span className={`icon ${icon}`} /> : null} {square ? null : text} <<<<<<< const {onDelete, item, buttonSize, text, disabled} = this.props ======= const {onDelete, item, buttonSize, icon, square} = this.props >>>>>>> const { onDelete, item, buttonSize, icon, square, text, disabled, } = this.props <<<<<<< disabled={disabled} ======= icon={icon} square={square} >>>>>>> icon={icon} square={square} disabled={disabled} <<<<<<< disabled: bool, } DeleteButton.defaultProps = { text: 'Delete', ======= icon: string, square: bool, >>>>>>> icon: string, square: bool, disabled: bool, text: string.isRequired, } DeleteButton.defaultProps = { text: 'Delete', <<<<<<< disabled: bool, ======= square: bool, icon: string, >>>>>>> square: bool, icon: string, disabled: bool,
<<<<<<< StaticServer.prototype.stop = function stop() { if (this._socket) { this._socket.close(); this._socket = null; ======= /** * Prepare the 'exit' handler for the program termination */ function initTerminateHandlers() { var readLine; if (process.platform === "win32"){ readLine = require("readline"); readLine.createInterface ({ input: process.stdin, output: process.stdout }).on("SIGINT", function () { process.emit("SIGINT"); }); >>>>>>> /** Stop listening */ StaticServer.prototype.stop = function stop() { if (this._socket) { this._socket.close(); this._socket = null; <<<<<<< function validPath(rootPath, file) { var resolvedPath = path.resolve(rootPath, file); ======= function validPath(file) { var resolvedPath = path.resolve(program.rootPath, file); var rootPath = path.resolve(program.rootPath); >>>>>>> function validPath(rootPath, file) { var resolvedPath = path.resolve(rootPath, file); <<<<<<< ======= relFile = path.relative(program.rootPath, file); nrmFile = path.normalize(req.path.substring(1)); >>>>>>>
<<<<<<< import DeprecationWarning from 'src/admin/components/DeprecationWarning' ======= import {ErrorHandling} from 'src/shared/decorators/errors' >>>>>>> import DeprecationWarning from 'src/admin/components/DeprecationWarning' import {ErrorHandling} from 'src/shared/decorators/errors'
<<<<<<< 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
<<<<<<< <form className="page-header__left" style={{flex: '1 0 0'}} onSubmit={this.handleFormSubmit} > ======= <form className="page-header__left" onSubmit={this.handleFormSubmit}> >>>>>>> <form className="page-header__left" style={{flex: '1 0 0'}} onSubmit={this.handleFormSubmit} > <<<<<<< name="name" ======= name="name" autoFocus={true} value={name} >>>>>>> name="name" value={name} <<<<<<< onKeyUp={this.handleKeyUp} autoFocus={true} spellCheck={false} autoComplete="off" ======= onKeyUp={this.handleKeyUp} autoComplete="off" >>>>>>> onKeyUp={this.handleKeyUp} autoFocus={true} spellCheck={false} autoComplete="off"
<<<<<<< return useAnchor ? <a className={classnames('sidebar__menu-item', {active: isActive})} href={link} target={isExternal ? '_blank' : '_self'} > {children} </a> : <Link className={classnames('sidebar__menu-item', {active: isActive})} to={link} > {children} </Link> ======= return ( <Link className={classnames('sidebar-menu--item', {active: isActive})} to={link} > {children} </Link> ) >>>>>>> return useAnchor ? <a className={classnames('sidebar-menu--item', {active: isActive})} href={link} target={isExternal ? '_blank' : '_self'} > {children} </a> : <Link className={classnames('sidebar-menu--item', {active: isActive})} to={link} > {children} </Link>
<<<<<<< var casperArgs = options.casperArgs || []; ======= var hideElements = options.hideElements || []; >>>>>>> var hideElements = options.hideElements || []; var casperArgs = options.casperArgs || []; <<<<<<< if (casperArgs) { args = args.concat(casperArgs); } ======= if (hideElements) { args.push('--hideelements=' + hideElements.join(',')); } >>>>>>> if (hideElements) { args.push('--hideelements=' + hideElements.join(',')); } if (casperArgs) { args = args.concat(casperArgs); }
<<<<<<< import React, {PropTypes, Component} from 'react' import buildInfluxQLQuery from 'utils/influxql' import classnames from 'classnames' ======= import React, {PropTypes, Component} from 'react' >>>>>>> import React, {PropTypes, Component} from 'react' import buildInfluxQLQuery from 'utils/influxql' import classnames from 'classnames' <<<<<<< getChildContext = () => { return {source: this.props.source} } handleChooseNamespace = namespace => { ======= handleChooseNamespace = namespace => { >>>>>>> getChildContext = () => { return {source: this.props.source} } handleChooseNamespace = namespace => { <<<<<<< const {query, timeRange: {lower}, isKapacitorRule} = this.props const statement = query.rawText || buildInfluxQLQuery({lower}, query, isKapacitorRule) return ( <div className="rule-section"> <h3 className="rule-section--heading">Select a Time Series</h3> <div className="rule-section--body"> <pre className="rule-section--border-bottom"> <code className={classnames({ 'metric-placeholder': !statement, })} > {statement || 'Build a query below'} </code> </pre> {this.renderQueryBuilder()} </div> </div> ) } renderQueryBuilder = () => { const {query, isKapacitorRule} = this.props ======= const {query, isKapacitorRule, isDeadman} = this.props >>>>>>> const {query, timeRange: {lower}, isKapacitorRule} = this.props const statement = query.rawText || buildInfluxQLQuery({lower}, query, isKapacitorRule) return ( <div className="rule-section"> <h3 className="rule-section--heading">Select a Time Series</h3> <div className="rule-section--body"> <pre className="rule-section--border-bottom"> <code className={classnames({ 'metric-placeholder': !statement, })} > {statement || 'Build a query below'} </code> </pre> {this.renderQueryBuilder()} </div> </div> ) } renderQueryBuilder = () => { const {query, isKapacitorRule, isDeadman} = this.props <<<<<<< } } const {bool, func, shape, string} = PropTypes DataSection.propTypes = { source: shape({ links: shape({ kapacitors: string.isRequired, }).isRequired, }), query: shape({ id: string.isRequired, }).isRequired, addFlashMessage: func, actions: shape({ chooseNamespace: func.isRequired, chooseMeasurement: func.isRequired, applyFuncsToField: func.isRequired, chooseTag: func.isRequired, groupByTag: func.isRequired, toggleField: func.isRequired, groupByTime: func.isRequired, toggleTagAcceptance: func.isRequired, }).isRequired, onAddEvery: func.isRequired, onRemoveEvery: func.isRequired, timeRange: shape({}).isRequired, isKapacitorRule: bool, } DataSection.childContextTypes = { source: PropTypes.shape({ links: PropTypes.shape({ proxy: PropTypes.string.isRequired, self: PropTypes.string.isRequired, }).isRequired, }).isRequired, } ======= } } const {string, func, shape, bool} = PropTypes DataSection.propTypes = { source: shape({ links: shape({ kapacitors: string.isRequired, }).isRequired, }), query: shape({ id: string.isRequired, }).isRequired, addFlashMessage: func, actions: shape({ chooseNamespace: func.isRequired, chooseMeasurement: func.isRequired, applyFuncsToField: func.isRequired, chooseTag: func.isRequired, groupByTag: func.isRequired, toggleField: func.isRequired, groupByTime: func.isRequired, toggleTagAcceptance: func.isRequired, }).isRequired, onAddEvery: func.isRequired, onRemoveEvery: func.isRequired, timeRange: shape({}).isRequired, isKapacitorRule: bool, isDeadman: bool, } >>>>>>> } } const {string, func, shape, bool} = PropTypes DataSection.propTypes = { source: shape({ links: shape({ kapacitors: string.isRequired, }).isRequired, }), query: shape({ id: string.isRequired, }).isRequired, addFlashMessage: func, actions: shape({ chooseNamespace: func.isRequired, chooseMeasurement: func.isRequired, applyFuncsToField: func.isRequired, chooseTag: func.isRequired, groupByTag: func.isRequired, toggleField: func.isRequired, groupByTime: func.isRequired, toggleTagAcceptance: func.isRequired, }).isRequired, onAddEvery: func.isRequired, onRemoveEvery: func.isRequired, timeRange: shape({}).isRequired, isKapacitorRule: bool, } DataSection.childContextTypes = { source: PropTypes.shape({ links: PropTypes.shape({ proxy: PropTypes.string.isRequired, self: PropTypes.string.isRequired, }).isRequired, }).isRequired, isDeadman: bool, }
<<<<<<< const {cell: {name, type, queries, axes, colors, legend}, sources} = props ======= const {cell: {queries}, sources} = props >>>>>>> const {cell: {queries, legend}, sources} = props <<<<<<< axes, singleStatType, gaugeColors: validateGaugeColors(colors), singleStatColors: validateSingleStatColors(colors, singleStatType), staticLegend: GET_STATIC_LEGEND(legend), ======= >>>>>>> staticLegend: GET_STATIC_LEGEND(legend), <<<<<<< const { queriesWorkingDraft, cellWorkingType: type, cellWorkingName: name, axes, gaugeColors, singleStatColors, staticLegend, } = this.state ======= const {queriesWorkingDraft} = this.state >>>>>>> const {queriesWorkingDraft, staticLegend} = this.state <<<<<<< handleSetBase = base => () => { const {axes} = this.state this.setState({ axes: { ...axes, y: { ...axes.y, base, }, }, }) } handleCellRename = newName => { this.setState({cellWorkingName: newName}) } handleSetScale = scale => () => { const {axes} = this.state this.setState({ axes: { ...axes, y: { ...axes.y, scale, }, }, }) } handleToggleStaticLegend = staticLegend => () => { this.setState({staticLegend}) } ======= >>>>>>> handleToggleStaticLegend = staticLegend => () => { this.setState({staticLegend}) } <<<<<<< singleStatType, staticLegend, ======= >>>>>>> staticLegend, <<<<<<< onCellRename={this.handleCellRename} staticLegend={staticLegend} ======= >>>>>>> staticLegend={staticLegend} <<<<<<< ? <DisplayOptions axes={axes} gaugeColors={gaugeColors} singleStatColors={singleStatColors} onChooseColor={this.handleChooseColor} onValidateColorValue={this.handleValidateColorValue} onUpdateColorValue={this.handleUpdateColorValue} onAddGaugeThreshold={this.handleAddGaugeThreshold} onAddSingleStatThreshold={this.handleAddSingleStatThreshold} onDeleteThreshold={this.handleDeleteThreshold} onToggleSingleStatType={this.handleToggleSingleStatType} singleStatType={singleStatType} onSetBase={this.handleSetBase} onSetLabel={this.handleSetLabel} onSetScale={this.handleSetScale} onToggleStaticLegend={this.handleToggleStaticLegend} staticLegend={staticLegend} queryConfigs={queriesWorkingDraft} selectedGraphType={cellWorkingType} onSetPrefixSuffix={this.handleSetPrefixSuffix} onSetSuffix={this.handleSetSuffix} onSelectGraphType={this.handleSelectGraphType} onSetYAxisBoundMin={this.handleSetYAxisBoundMin} onSetYAxisBoundMax={this.handleSetYAxisBoundMax} /> ======= ? <DisplayOptions queryConfigs={queriesWorkingDraft} /> >>>>>>> ? <DisplayOptions queryConfigs={queriesWorkingDraft} onToggleStaticLegend={this.handleToggleStaticLegend} staticLegend={staticLegend} />
<<<<<<< // import {errorThrown} from 'shared/actions/errors' import parsers from 'shared/parsing' ======= import {errorThrown} from 'shared/actions/errors' >>>>>>> import parsers from 'shared/parsing' import {errorThrown} from 'shared/actions/errors' <<<<<<< dispatch( publishNotification( 'error', `Failed to delete dashboard: ${error.data.message}.` ) ) ======= >>>>>>>
<<<<<<< import { flagStyle, clickAreaStyle, annotationStyle, } from 'src/shared/annotations/styles' const idAppendage = '-end' class Annotation extends Component { state = { isDragging: false, isMouseOver: false, } isEndpoint = () => { const {annotation: {id}} = this.props return id.substring(id.length - idAppendage.length) === idAppendage } getStartID = () => { const {annotation: {id}} = this.props return id.substring(0, id.length - idAppendage.length) } handleStartDrag = () => { const {mode} = this.props if (mode === ADDING || mode === null) { return } this.setState({isDragging: true}) } handleStopDrag = () => { this.setState({isDragging: false}) } handleMouseEnter = () => { this.setState({isMouseOver: true}) } handleMouseLeave = e => { const {annotation} = this.props if (e.relatedTarget.id === `tooltip-${annotation.id}`) { return this.setState({isDragging: false}) } this.setState({isDragging: false, isMouseOver: false}) } handleDrag = e => { if (!this.state.isDragging) { return } const {pageX} = e const {annotation, annotations, dygraph, onUpdateAnnotation} = this.props const {time, duration} = annotation const {left} = dygraph.graphDiv.getBoundingClientRect() const [startX, endX] = dygraph.xAxisRange() const graphX = pageX - left let newTime = dygraph.toDataXCoord(graphX) const oldTime = +time const minPercentChange = 0.5 if ( Math.abs( dygraph.toPercentXCoord(newTime) - dygraph.toPercentXCoord(oldTime) ) * 100 < minPercentChange ) { return } if (newTime >= endX) { newTime = endX } if (newTime <= startX) { newTime = startX } if (this.isEndpoint()) { const startAnnotation = annotations.find(a => a.id === this.getStartID()) if (!startAnnotation) { return console.error('Start annotation does not exist') } const newDuration = newTime - oldTime + Number(startAnnotation.duration) this.counter = this.counter + 1 return onUpdateAnnotation({ ...startAnnotation, duration: `${newDuration}`, }) } if (duration) { const differenceInTimes = oldTime - newTime const newDuration = Number(duration) + differenceInTimes return onUpdateAnnotation({ ...annotation, time: `${newTime}`, duration: `${newDuration}`, }) } onUpdateAnnotation({...annotation, time: `${newTime}`}) e.preventDefault() e.stopPropagation() } handleConfirmUpdate = annotation => { const {onUpdateAnnotation} = this.props if (this.isEndpoint()) { const id = this.getStartID() return onUpdateAnnotation({...annotation, id}) } onUpdateAnnotation(annotation) } handleDeleteAnnotation = () => { this.props.onDeleteAnnotation(this.props.annotation) } render() { const {dygraph, annotation, mode, staticLegendHeight} = this.props const {isDragging, isMouseOver} = this.state const humanTime = `${new Date(+annotation.time)}` const hasDuration = !!annotation.duration if (annotation.id === TEMP_ANNOTATION.id) { return null } const isEditing = mode === EDITING return ( <div className="dygraph-annotation" style={annotationStyle( annotation, dygraph, isMouseOver, isDragging, staticLegendHeight )} data-time-ms={annotation.time} data-time-local={humanTime} > <div style={clickAreaStyle(isDragging, isEditing)} onMouseMove={this.handleDrag} onMouseDown={this.handleStartDrag} onMouseUp={this.handleStopDrag} onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave} /> <div style={flagStyle( isMouseOver, isDragging, hasDuration, this.isEndpoint() )} /> <AnnotationTooltip isEditing={isEditing} ======= const Annotation = ({dygraph, annotation, mode, lastUpdated}) => <div> {annotation.startTime === annotation.endTime ? <AnnotationPoint lastUpdated={lastUpdated} >>>>>>> const Annotation = ({ dygraph, annotation, mode, lastUpdated, staticLegendHeight, }) => <div> {annotation.startTime === annotation.endTime ? <AnnotationPoint lastUpdated={lastUpdated} <<<<<<< const {arrayOf, func, number, shape, string} = PropTypes ======= const {number, shape, string} = PropTypes >>>>>>> const {number, shape, string} = PropTypes <<<<<<< onUpdateAnnotation: func.isRequired, onDeleteAnnotation: func.isRequired, staticLegendHeight: number, ======= >>>>>>> staticLegendHeight: number,
<<<<<<< synchronizer, ======= timeRange, isInDataExplorer, >>>>>>> synchronizer, timeRange, <<<<<<< synchronizer={synchronizer} ======= timeRange={timeRange} legendOnBottom={isInDataExplorer} >>>>>>> synchronizer={synchronizer} timeRange={timeRange}
<<<<<<< const { topHeightPixels, bottomHeightPixels, topHeight, bottomHeight, isDragging, } = this.state const {containerClass, children} = this.props ======= const {bottomHeightPixels, topHeight, bottomHeight, isDragging} = this.state const {containerClass, children, theme} = this.props >>>>>>> const { topHeightPixels, bottomHeightPixels, topHeight, bottomHeight, isDragging, } = this.state const {containerClass, children, theme} = this.props
<<<<<<< import StaticLegend from 'src/shared/components/StaticLegend' import Annotations from 'src/shared/components/Annotations' import getRange, {getStackedRange} from 'shared/parsing/getRangeForDygraph' ======= import Annotations from 'src/shared/components/Annotations' import getRange, {getStackedRange} from 'shared/parsing/getRangeForDygraph' >>>>>>> import StaticLegend from 'src/shared/components/StaticLegend' import Annotations from 'src/shared/components/Annotations' import getRange, {getStackedRange} from 'shared/parsing/getRangeForDygraph' <<<<<<< staticLegendHeight: null, ======= >>>>>>> staticLegendHeight: null, <<<<<<< handleAnnotationsRef = ref => (this.annotationsRef = ref) handleReceiveStaticLegendHeight = staticLegendHeight => { this.setState({staticLegendHeight}) } ======= handleAnnotationsRef = ref => (this.annotationsRef = ref) >>>>>>> handleAnnotationsRef = ref => (this.annotationsRef = ref) handleReceiveStaticLegendHeight = staticLegendHeight => { this.setState({staticLegendHeight}) } <<<<<<< const {isHidden, staticLegendHeight} = this.state const {staticLegend} = this.props let dygraphStyle = {...this.props.containerStyle, zIndex: '2'} if (staticLegend) { const cellVerticalPadding = 16 dygraphStyle = { ...this.props.containerStyle, zIndex: '2', height: `calc(100% - ${staticLegendHeight + cellVerticalPadding}px)`, } } ======= const {isHidden} = this.state const {mode} = this.props const hideLegend = mode === EDITING || mode === ADDING ? true : isHidden >>>>>>> const {isHidden, staticLegendHeight} = this.state const {staticLegend,mode} = this.props const hideLegend = mode === EDITING || mode === ADDING ? true : isHidden let dygraphStyle = {...this.props.containerStyle, zIndex: '2'} if (staticLegend) { const cellVerticalPadding = 16 dygraphStyle = { ...this.props.containerStyle, zIndex: '2', height: `calc(100% - ${staticLegendHeight + cellVerticalPadding}px)`, } } <<<<<<< <Annotations annotationsRef={this.handleAnnotationsRef} staticLegendHeight={staticLegendHeight} /> {this.dygraph && <DygraphLegend isHidden={isHidden} dygraph={this.dygraph} onHide={this.handleHideLegend} onShow={this.handleShowLegend} />} ======= <Annotations annotationsRef={this.handleAnnotationsRef} /> {this.dygraph && <DygraphLegend isHidden={hideLegend} dygraph={this.dygraph} onHide={this.handleHideLegend} onShow={this.handleShowLegend} />} >>>>>>> <Annotations annotationsRef={this.handleAnnotationsRef} staticLegendHeight={staticLegendHeight} /> {this.dygraph && <DygraphLegend isHidden={isHidden} dygraph={this.dygraph} onHide={this.handleHideLegend} onShow={this.handleShowLegend} />} <<<<<<< style={dygraphStyle} ======= style={{...this.props.containerStyle, zIndex: '2'}} >>>>>>> style={dygraphStyle}
<<<<<<< hoverTime, onSetHoverTime, queryASTs, onNewQueryAST, ======= >>>>>>> queryASTs, onNewQueryAST,
<<<<<<< confirmPasswordError: string, ======= sendLogsStatus: string, >>>>>>> confirmPasswordError: string, sendLogsStatus: string, <<<<<<< sendLogs(string): void, resetConfirmPasswordError(Object): void ======= sendLogs(string): void, resetSendLogsStatus(): void, onTogglePinLoginEnabled(enableLogin: boolean): void >>>>>>> sendLogs(string): void, resetConfirmPasswordError(Object): void, resetSendLogsStatus(): void, onTogglePinLoginEnabled(enableLogin: boolean): void
<<<<<<< import { TextInput, PasswordInput } from './components' ======= >>>>>>>
<<<<<<< import { TouchableWithoutFeedback, Image, ScrollView, ListView, Text, TextInput, View, StyleSheet, TouchableHighlight, Animated } from 'react-native' ======= import Locale from 'react-native-locale' import { TouchableWithoutFeedback, Image, ScrollView, ListView, Text, TextInput, View, StyleSheet, TouchableHighlight, Animated } from 'react-native' >>>>>>> import { TouchableWithoutFeedback, Image, ScrollView, ListView, Text, TextInput, View, StyleSheet, TouchableHighlight, Animated } from 'react-native' import Locale from 'react-native-locale' <<<<<<< toggleArchiveDropdown = () => { ======= constructor(props){ super(props) const localeInfo = Locale.constants() // should likely be moved to login system and inserted into Redux console.log('localeInfo is: ', localeInfo) } forceArchiveListUpdate (archiveOrder) { this.props.dispatch(updateArchiveListOrder(archiveOrder)) } toggleArchiveDropdown () { >>>>>>> toggleArchiveDropdown = () => { <<<<<<< { this.renderActiveSortableList( wallets, activeWalletIds, 'Archive', this.renderActiveRow, this.onActiveRowMoved ) ======= {console.log('walletListArray', walletListArray)} {(walletListArray.length > 0) && <SortableListView style={styles.sortableWalletList} data={walletListArray} order={walletOrder} onRowMoved={e => { walletOrder.splice(e.to, 0, walletOrder.splice(e.from, 1)[0]) this.props.dispatch(updateWalletListOrder(walletOrder, this.props.walletList, walletListArray)) }} renderRow={row => <WalletListRow data={row} archiveLabel={sprintf('%s', t('fragmet_wallets_list_archive_title_capitalized'))} />} /> >>>>>>> { this.renderActiveSortableList( wallets, activeWalletIds, 'Archive', this.renderActiveRow, this.onActiveRowMoved ) <<<<<<< { this.renderArchivedSortableList( wallets, archivedWalletIds, 'Restore', this.renderArchivedRow, this.onArchivedRowMoved ) ======= {this.props.archiveVisible && <SortableListView style={styles.sortableWalletList} data={archiveListArray} order={archiveOrder} render='archive' onRowMoved={e => { archiveOrder.splice(e.to, 0, archiveOrder.splice(e.from, 1)[0]) this.forceArchiveListUpdate(archiveOrder) }} renderRow={row => <WalletListRow archiveLabel={sprintf('%s', t('fragmet_wallets_list_restore_title_capitalized'))} data={row} />} /> >>>>>>> { this.renderArchivedSortableList( wallets, archivedWalletIds, 'Restore', this.renderArchivedRow, this.onArchivedRowMoved )
<<<<<<< export const SET_LTC_DENOMINATION = PREFIX + 'SET_LITECOIN_DENOMINATION' export const SET_ETH_DENOMINATION = PREFIX + 'SET_ETHEREUM_DENOMINATION' export const SET_REP_DENOMINATION = PREFIX + 'SET_REP_DENOMINATION' export const SET_WINGS_DENOMINATION = PREFIX + 'SET_WINGS_DENOMINATION' export const SET_LUN_DENOMINATION = PREFIX + 'SET_LUNYR_DENOMINATION' ======= >>>>>>>
<<<<<<< import sideMenu from '../modules/SideMenu/SideMenu.reducer' import transactionList from '../modules/Transactions/Transactions.reducer' import scan from '../modules/Scan/Scan.reducer' import controlPanel from '../modules/ControlPanel/reducer' import walletList from '../modules/WalletList/WalletList.reducer' import walletTransferListReducer from '../modules/WalletTransferList/WalletTransferList.reducer' import addWallet from '../modules/AddWallet/reducer' ======= import * as SideMenu from '../modules/SideMenu/SideMenu.reducer' import * as Transactions from '../modules/Transactions/Transactions.reducer' import * as Scan from '../modules/Scan/Scan.reducer' import * as ControlPanel from '../modules/ControlPanel/reducer' import * as WalletList from '../modules/WalletList/WalletList.reducer' import * as WalletTransferList from '../modules/WalletTransferList/WalletTransferList.reducer' import * as AddWallet from '../modules/AddWallet/reducer' import { airbitz, account } from '../modules/Login/Login.reducer.js' >>>>>>> import sideMenu from '../modules/SideMenu/SideMenu.reducer' import transactionList from '../modules/Transactions/Transactions.reducer' import scan from '../modules/Scan/Scan.reducer' import controlPanel from '../modules/ControlPanel/reducer' import walletList from '../modules/WalletList/WalletList.reducer' import walletTransferListReducer from '../modules/WalletTransferList/WalletTransferList.reducer' import addWallet from '../modules/AddWallet/reducer' import { airbitz, account } from '../modules/Login/Login.reducer.js' <<<<<<< airbitz: Login.airbitz, account: Login.account, request, //transactions, routes, ======= airbitz, account, sidemenu: combineReducers({ view: SideMenu.view }), transactions: combineReducers({ transactionsList: Transactions.transactionsList, searchVisible: Transactions.searchVisible, contactsList: Transactions.contactsList }), scan: combineReducers({ torchEnabled: Scan.torchEnabled, addressModalVisible: Scan.addressModalVisible, recipientAddress: Scan.recipientAddress }), controlPanel: combineReducers({ usersView: ControlPanel.usersView, usersList: ControlPanel.usersList, selectedUser: ControlPanel.selectedUser }), walletList: combineReducers({ archiveVisible: WalletList.archiveVisible, renameWalletVisible: WalletList.renameWalletVisible, deleteWalletVisible: WalletList.deleteWalletVisible, currentWalletRename: WalletList.currentWalletRename, currentWalletBeingRenamed: WalletList.currentWalletBeingRenamed, currentWalletBeingDeleted: WalletList.currentWalletBeingDeleted }), walletTransferList: combineReducers({ walletTransferList: WalletTransferList.walletTransferList, walletListModalVisible: WalletTransferList.walletListModalVisible }), >>>>>>> request, //transactions, routes, airbitz, account,
<<<<<<< import styles from './style' import {TwoButtonModalStyle} from '../../../../styles/indexStyles.js' ======= import SafeAreaView from '../../components/SafeAreaView/index.js' >>>>>>> import styles from './style' import {TwoButtonModalStyle} from '../../../../styles/indexStyles.js' import SafeAreaView from '../../components/SafeAreaView/index.js' <<<<<<< import s from '../../../../locales/strings.js' import {intl} from '../../../../locales/intl' import * as Constants from '../../../../constants/indexConstants.js' import * as UTILS from '../../../utils' import WalletIcon from '../../../../assets/images/walletlist/my-wallets.png' import { PLATFORM } from '../../../../theme/variables/platform.js' import {StaticModalComponent, TwoButtonTextModalComponent} from '../../../../components/indexComponents.js' import iconImage from '../../../../assets/images/otp/OTP-badge_sm.png' import type {GuiContact} from '../../../../types' ======= import WalletOptions from './components/WalletOptions/WalletOptionsConnector.ui.js' import styles from './style' >>>>>>> import WalletOptions from './components/WalletOptions/WalletOptionsConnector.ui.js' import iconImage from '../../../../assets/images/otp/OTP-badge_sm.png'
<<<<<<< <FormattedText style={[styles.modalTopText, border('yellow')]}>{this.props.headerText}</FormattedText> {this.props.headerSubtext && <FormattedText style={[styles.modalTopSubtext, border('green')]} numberOfLines={2}> {this.props.headerSubtext || ''} </FormattedText> } ======= <FormattedText style={[styles.modalTopText, border('yellow')]}>{sprintf('%s', t(this.props.headerText))}</FormattedText> >>>>>>> <FormattedText style={[styles.modalTopText, border('yellow')]}>{sprintf('%s', t(this.props.headerText))}</FormattedText> {this.props.headerSubtext && <FormattedText style={[styles.modalTopSubtext, border('green')]} numberOfLines={2}> {this.props.headerSubtext || ''} </FormattedText> }
<<<<<<< export const getSyncedSubcategories = account => { dumpFolder(account.folder) return getSyncedSubcategoriesFile(account).getText() .then(text => { ======= export const getSyncedSubcategories = (account) => getSyncedSubcategoriesFile(account).getText() .then((text) => { >>>>>>> export const getSyncedSubcategories = (account) => getSyncedSubcategoriesFile(account).getText() .then((text) => { <<<<<<< export async function setLocalLogRequest (account, log) { return setLocalLog(account, log) } export const getLocalSettings = account => ======= export const getLocalSettings = (account) => >>>>>>> export async function setLocalLogRequest (account, log) { return setLocalLog(account, log) } export const getLocalSettings = (account) => <<<<<<< export const getLocalLogFile = account => account.folder.file('Log.txt') export const getSyncedSettingsFile = account => account.folder.file('Settings.json') ======= export const getSyncedSettingsFile = (account) => account.folder.file('Settings.json') >>>>>>> export const getLocalLogFile = (account) => account.folder.file('Log.txt') export const getSyncedSettingsFile = (account) => account.folder.file('Settings.json')
<<<<<<< import * as AddWallet from '../modules/AddWallet/reducer' ======= import { airbitz, account } from '../modules/Login/Login.reducer.js' >>>>>>> import * as AddWallet from '../modules/AddWallet/reducer' import { airbitz, account } from '../modules/Login/Login.reducer.js' <<<<<<< addWallet: combineReducers({ newWalletName: AddWallet.newWalletName }), ======= >>>>>>> addWallet: combineReducers({ newWalletName: AddWallet.newWalletName }),
<<<<<<< import React from 'react' ======= // @flow >>>>>>> // @flow import React from 'react' <<<<<<< import {TextAndIconButton} from '../../../components/Buttons/TextAndIconButton.ui' import {SelectedWalletNameHeader} from './SelectedWalletNameHeader.ui' ======= import type {State, Dispatch} from '../../../../ReduxTypes' import WalletSelector from './WalletSelector.ui' import type {StateProps, DispatchProps} from './WalletSelector.ui' >>>>>>> import type {State, Dispatch} from '../../../../ReduxTypes' import WalletSelector from './WalletSelector.ui' import type {StateProps, DispatchProps} from './WalletSelector.ui' import {SelectedWalletNameHeader} from './SelectedWalletNameHeader.ui' <<<<<<< ? function HeaderComp (styles) { return (<SelectedWalletNameHeader name={selectedWallet.name} selectedWalletCurrencyCode={selectedWalletCurrencyCode} styles={styles}/>) } : LOADING_TEXT return { title, style: {...Styles.TextAndIconButtonStyle, content: {...Styles.TextAndIconButtonStyle.content, position: 'relative', width: '80%'}, centeredContent: {...Styles.TextAndIconButtonStyle.centeredContent, position: 'relative', width: '80%'}}, icon: Constants.KEYBOARD_ARROW_DOWN, iconType: Constants.MATERIAL_ICONS } ======= ? selectedWallet.name + ':' + selectedWalletCurrencyCode : s.strings.loading return { title } >>>>>>> ? function HeaderComp (styles) { return (<SelectedWalletNameHeader name={selectedWallet.name} selectedWalletCurrencyCode={selectedWalletCurrencyCode} styles={styles}/>) } : s.strings.loading return { title }
<<<<<<< render () { return ( <View style={styles.container}> {this.renderCamera()} <View style={[styles.overlay]}> <AddressModal /> <View style={[styles.overlayTop]}> <T style={[styles.overlayTopText]}>{sprintf(strings.enUS['send_scan_header_text'])}</T> </View> <View style={[styles.overlayBlank]} /> <Gradient style={[styles.overlayButtonAreaWrap]}> <TouchableHighlight style={[styles.transferButtonWrap, styles.bottomButton]} onPress={this._onToggleWalletListModal} activeOpacity={0.3} underlayColor={'#FFFFFF'}> <View style={styles.bottomButtonTextWrap}> <Ionicon name='ios-arrow-round-forward' size={24} style={[styles.transferArrowIcon]} /> <T style={[styles.transferButtonText, styles.bottomButtonText]}>{sprintf(strings.enUS['fragment_send_transfer'])}</T> </View> </TouchableHighlight> <TouchableHighlight style={[styles.addressButtonWrap, styles.bottomButton]} onPress={this._onToggleAddressModal} activeOpacity={0.3} underlayColor={'#FFFFFF'}> <View style={styles.bottomButtonTextWrap}> <FAIcon name={Constants.ADDRESS_BOOK_O} size={18} style={[styles.addressBookIcon]} /> <T style={[styles.addressButtonText, styles.bottomButtonText]}>{sprintf(strings.enUS['fragment_send_address'])}</T> </View> </TouchableHighlight> <TouchableHighlight style={[styles.photosButtonWrap, styles.bottomButton]} onPress={this.selectPhotoTapped} activeOpacity={0.3} underlayColor={'#FFFFFF'}> <View style={styles.bottomButtonTextWrap}> <Ionicon name='ios-camera-outline' size={24} style={[styles.cameraIcon]} /> <T style={[styles.bottomButtonText]}>{sprintf(strings.enUS['fragment_send_photos'])}</T> </View> </TouchableHighlight> <TouchableHighlight style={[styles.flashButtonWrap, styles.bottomButton]} onPress={this._onToggleTorch} activeOpacity={0.3} underlayColor={'#FFFFFF'}> <View style={styles.bottomButtonTextWrap}> <Ionicon name='ios-flash-outline' size={24} style={[styles.flashIcon]} /> <T style={[styles.flashButtonText, styles.bottomButtonText]}>{sprintf(strings.enUS['fragment_send_flash'])}</T> </View> </TouchableHighlight> </Gradient> </View> </View> ) } ======= >>>>>>>
<<<<<<< import {intl} from '../../../../locales/intl' ======= import * as Constants from '../../../../constants/indexConstants.js' >>>>>>> import {intl} from '../../../../locales/intl' import * as Constants from '../../../../constants/indexConstants.js'
<<<<<<< import * as Wallets from '../modules/Wallets/Wallets.reducer.js' ======= import Wallets from '../modules/Wallets/Wallets.reducer.js' import Request from '../modules/Request/Request.reducer.js' >>>>>>> import * as Wallets from '../modules/Wallets/Wallets.reducer.js' import Request from '../modules/Request/Request.reducer.js' <<<<<<< wallets: combineReducers({ wallets: Wallets.wallets, walletList: Wallets.walletList, walletListOrder: Wallets.walletListOrder }), ======= wallets: Wallets.addWallet, selectedWallet: Wallets.selectWallet, request: Request, >>>>>>> wallets: combineReducers({ wallets: Wallets.wallets, walletList: Wallets.walletList, walletListOrder: Wallets.walletListOrder, selectedWallet: Wallets.selectedWallet, }), request: Request,
<<<<<<< return <FAIcon name={Constants.TRASH_O} size={24} color={c.primary} style={[{ ======= return <FAIcon name='trash-o' size={24} color={THEME.COLORS.PRIMARY} style={[{ >>>>>>> return <FAIcon name={Constants.TRASH_O} size={24} color={THEME.COLORS.PRIMARY} style={[{
<<<<<<< const precision = secondaryInfo.displayDenomination.multiplier ? log10(secondaryInfo.displayDenomination.multiplier) : 0 const formattedSecondaryDisplayAmount: string = (parseFloat(getDisplayExchangeAmount(secondaryDisplayAmount)).toFixed(precision)) const secondaryCurrencyCode: string = secondaryInfo.displayDenomination.name ======= let formattedSecondaryDisplayAmount: string = (parseFloat(getDisplayExchangeAmount(secondaryDisplayAmount)).toFixed(secondaryInfo.displayDenomination.precision)) let precision = secondaryInfo.displayDenomination.precision // if exchange rate is too low, then add decimal places if (parseFloat(formattedSecondaryDisplayAmount) <= 0.1) { precision += 3 formattedSecondaryDisplayAmount = (parseFloat(getDisplayExchangeAmount(secondaryDisplayAmount)).toFixed(precision)) } const secondaryCurrencyCode: string = secondaryInfo.displayDenomination.currencyCode >>>>>>> let precision = secondaryInfo.displayDenomination.multiplier ? log10(secondaryInfo.displayDenomination.multiplier) : 0 let formattedSecondaryDisplayAmount: string = (parseFloat(getDisplayExchangeAmount(secondaryDisplayAmount)).toFixed(precision)) // if exchange rate is too low, then add decimal places if (parseFloat(formattedSecondaryDisplayAmount) <= 0.1) { precision += 3 formattedSecondaryDisplayAmount = (parseFloat(getDisplayExchangeAmount(secondaryDisplayAmount)).toFixed(precision)) } const secondaryCurrencyCode: string = secondaryInfo.displayDenomination.name
<<<<<<< loading: props.loading, result: '' ======= keyboardUp: false, loading: props.loading >>>>>>> loading: props.loading, result: '', keyboardUp: false <<<<<<< onAmountsChange = ({primaryDisplayAmount}: {primaryDisplayAmount: string}) => { ======= componentWillMount () { this.keyboardWillShowListener = Keyboard.addListener('keyboardWillShow', this.keyboardWillShow.bind(this)) this.keyboardWillHideListener = Keyboard.addListener('keyboardWillHide', this.keyboardWillHide.bind(this)) } componentWillUnmount () { this.keyboardWillShowListener.remove() this.keyboardWillHideListener.remove() } onAmountsChange = ({primaryDisplayAmount}) => { >>>>>>> componentWillMount () { this.keyboardWillShowListener = Keyboard.addListener('keyboardWillShow', this.keyboardWillShow.bind(this)) this.keyboardWillHideListener = Keyboard.addListener('keyboardWillHide', this.keyboardWillHide.bind(this)) } componentWillUnmount () { this.keyboardWillShowListener.remove() this.keyboardWillHideListener.remove() } onAmountsChange = ({primaryDisplayAmount}: {primaryDisplayAmount: string}) => {
<<<<<<< }) */ ======= }) this.refs._scrollView.scrollTo({x: 0, y: 0, animated: true}) >>>>>>> }) */ this.refs._scrollView.scrollTo({x: 0, y: 0, animated: true}) <<<<<<< onSelectPayee = (input) => { console.log('payeeName selected as: ', input) this.setState({ payeeName: input, contactSearchVisibility: false }) } ======= onSelectPayee = (input) => { this.onChangePayee(input) this.onBlurPayee() this.refs._scrollView.scrollTo({x: 0, y: 0, animated: true}) } >>>>>>> onSelectPayee = (input) => { this.onChangePayee(input) this.onBlurPayee() this.refs._scrollView.scrollTo({x: 0, y: 0, animated: true}) } <<<<<<< blurOnSubmit ======= blurOnSubmit onSubmitEditing={this.onBlurPayee} >>>>>>> blurOnSubmit onSubmitEditing={this.onBlurPayee}
<<<<<<< import { addWallet, selectWallet } from './Wallets/Wallets.action.js' import { initializeAccount } from './Container.middleware' import {enableLoadingScreenVisibility} from './Container.action' ======= import { addWallet, selectWallet } from './UI/Wallets/Wallets.action.js' >>>>>>> import { initializeAccount } from './Container.middleware' import {enableLoadingScreenVisibility} from './Container.action' import { addWallet, selectWallet } from './UI/Wallets/Wallets.action.js'
<<<<<<< const TRANSACTION_DETAILS = s.strings.title_transaction_details const WALLETS = s.strings.title_wallets const CREATE_WALLET = s.strings.title_create_wallet const REQUEST = s.strings.title_request const SEND = s.strings.title_send const EDGE_LOGIN = s.strings.title_edge_login const EXCHANGE = s.strings.title_exchange ======= const TRANSACTION_DETAILS = s.strings.title_transaction_details const WALLETS = s.strings.title_wallets const CREATE_WALLET_SELECT_CRYPTO = s.strings.title_create_wallet_select_crypto const CREATE_WALLET_SELECT_FIAT = s.strings.title_create_wallet_select_fiat const CREATE_WALLET = s.strings.title_create_wallet const REQUEST = s.strings.title_request const SEND = s.strings.title_send const EDGE_LOGIN = s.strings.title_edge_login const EXCHANGE = s.strings.title_exchange >>>>>>> const TRANSACTION_DETAILS = s.strings.title_transaction_details const WALLETS = s.strings.title_wallets const CREATE_WALLET_SELECT_CRYPTO = s.strings.title_create_wallet_select_crypto const CREATE_WALLET_SELECT_FIAT = s.strings.title_create_wallet_select_fiat const CREATE_WALLET = s.strings.title_create_wallet const REQUEST = s.strings.title_request const SEND = s.strings.title_send const EDGE_LOGIN = s.strings.title_edge_login const EXCHANGE = s.strings.title_exchange <<<<<<< <Modal hideNavBar transitionConfig={() => ({screenInterpolator: CardStackStyleInterpolator.forFadeFromBottomAndroid})}> <Stack key={Constants.ROOT} hideNavBar> <Scene key={Constants.LOGIN} initial component={LoginConnector} username={this.props.username} /> <Scene key={Constants.TRANSACTION_DETAILS} navTransparent={true} clone ======= <Modal hideNavBar transitionConfig={() => ({ screenInterpolator: CardStackStyleInterpolator.forFadeFromBottomAndroid })}> {/* <Lightbox> */} <Stack key="root" hideNavBar panHandlers={null}> <Scene key={Constants.LOGIN} initial component={LoginConnector} username={this.props.username} /> <Scene key={Constants.TRANSACTION_DETAILS} navTransparent={true} clone >>>>>>> <Modal hideNavBar transitionConfig={() => ({ screenInterpolator: CardStackStyleInterpolator.forFadeFromBottomAndroid })}> {/* <Lightbox> */} <Stack key={Constants.ROOT} hideNavBar panHandlers={null}> <Scene key={Constants.LOGIN} initial component={LoginConnector} username={this.props.username} /> <Scene key={Constants.TRANSACTION_DETAILS} navTransparent={true} clone <<<<<<< <Tabs key={Constants.EDGE} swipeEnabled={true} navTransparent={true} tabBarPosition={'bottom'} showLabel={true}> ======= <Tabs key="edge" swipeEnabled={true} navTransparent={true} tabBarPosition={'bottom'} showLabel={true}> >>>>>>> <Tabs key={Constants.EDGE} swipeEnabled={true} navTransparent={true} tabBarPosition={'bottom'} showLabel={true}> <<<<<<< <Scene key={Constants.WALLET_LIST_NOT_USED} navTransparent={true} ======= <Scene key={Constants.WALLET_LIST_SCENE} navTransparent={true} >>>>>>> <Scene key={Constants.WALLET_LIST_SCENE} navTransparent={true} <<<<<<< <Scene key={Constants.SCAN_NOT_USED} navTransparent={true} onEnter={this.props.dispatchEnableScan} onExit={this.props.dispatchDisableScan} ======= <Scene key="scan_notused" navTransparent={true} onEnter={this.props.dispatchEnableScan} onExit={this.props.dispatchDisableScan} >>>>>>> <Scene key={Constants.SCAN_NOT_USED} navTransparent={true} onEnter={this.props.dispatchEnableScan} onExit={this.props.dispatchDisableScan} <<<<<<< <Scene key={Constants.EXCHANGE_NOT_USED} navTransparent={true} ======= <Scene key="exchange_notused" navTransparent={true} >>>>>>> <Scene key={Constants.EXCHANGE_NOT_USED} navTransparent={true} <<<<<<< <Scene key={Constants.SEND_CONFIRMATION_NOT_USED} navTransparent={true} hideTabBar panHandlers={null} ======= <Scene key="sendconfirmation_notused" navTransparent={true} hideTabBar panHandlers={null} >>>>>>> <Scene key={Constants.SEND_CONFIRMATION_NOT_USED} navTransparent={true} hideTabBar panHandlers={null} <<<<<<< <Stack key={Constants.MANAGE_TOKENS} hideTabBar> <Scene key={Constants.MANAGE_TOKENS_NOT_USED} navTransparent={true} component={ManageTokens} renderTitle={this.renderTitle(MANAGE_TOKENS)} renderLeftButton={this.renderBackButton()} renderRightButton={this.renderEmptyButton} /> <Scene key={Constants.ADD_TOKEN} navTransparent={true} component={AddToken} renderTitle={this.renderTitle(ADD_TOKENS)} renderLeftButton={this.renderBackButton()} renderRightButton={this.renderEmptyButton} /> </Stack> <Stack key={Constants.SETTINGS_OVERVIEW_TAB} hideDrawerButton={true}> <Scene key={Constants.SETTINGS_OVERVIEW} navTransparent={true} ======= <Stack key="settingsOverviewTab" hideDrawerButton={true}> <Scene key={Constants.SETTINGS_OVERVIEW} navTransparent={true} >>>>>>> <Stack key={Constants.SETTINGS_OVERVIEW_TAB} hideDrawerButton={true}> <Scene key={Constants.SETTINGS_OVERVIEW} navTransparent={true} <<<<<<< <Scene key={Constants.DEFAULT_FIAT_SETTING} navTransparent={true} ======= <Scene key="defaultFiatSetting" navTransparent={true} >>>>>>> <Scene key={Constants.DEFAULT_FIAT_SETTING} navTransparent={true} <<<<<<< ======= {/* </Lightbox> */} >>>>>>> {/* </Lightbox> */} <<<<<<< renderWalletListNavBar = () => { return <Header/> } renderEmptyButton = () => () => { return <BackButton /> } renderHelpButton = () => { return <HelpButton/> } renderBackButton = (label: string = BACK) => () => { return <BackButton withArrow onPress={this.handleBack} label={label} /> } renderTitle = (title: string) => { return <T style={styles.titleStyle}>{title}</T> } renderMenuButton = () => { return <TouchableWithoutFeedback onPress={Actions.drawerOpen}><Image source={MenuIcon}/></TouchableWithoutFeedback> } renderExchangeButton = () => { return <ExchangeDropMenu/> } renderSendConfirmationButton = () => { return <SendConfirmationOptions/> } icon = (tabName: string) => (props: {focused: boolean}) => { ======= renderWalletListNavBar = () => <Header /> renderEmptyButton = () => () => <BackButton /> renderHelpButton = () => <HelpButton /> renderBackButton = (label: string = BACK) => () => <BackButton withArrow onPress={this.handleBack} label={label} /> renderTitle = (title: string) => { return <T style={styles.titleStyle}>{title}</T> } renderMenuButton = () => ( <TouchableWithoutFeedback onPress={Actions.drawerOpen}> <Image source={MenuIcon} /> </TouchableWithoutFeedback> ) renderExchangeButton = () => <ExchangeDropMenu /> renderSendConfirmationButton = () => <SendConfirmationOptions /> icon = (tabName: string) => (props: { focused: boolean }) => { >>>>>>> renderWalletListNavBar = () => { return <Header/> } renderEmptyButton = () => () => { return <BackButton /> } renderHelpButton = () => { return <HelpButton/> } renderBackButton = (label: string = BACK) => () => { return <BackButton withArrow onPress={this.handleBack} label={label} /> } renderTitle = (title: string) => { return <T style={styles.titleStyle}>{title}</T> } renderMenuButton = () => { return <TouchableWithoutFeedback onPress={Actions.drawerOpen}> <Image source={MenuIcon}/> </TouchableWithoutFeedback> } renderExchangeButton = () => { return <ExchangeDropMenu/> } renderSendConfirmationButton = () => { return <SendConfirmationOptions/> } icon = (tabName: string) => (props: {focused: boolean}) => { <<<<<<< if (!this.isCurrentScene(Constants.WALLET_LIST_NOT_USED)) { ======= if (!this.isCurrentScene(Constants.WALLET_LIST_SCENE)) { >>>>>>> if (!this.isCurrentScene(Constants.WALLET_LIST_SCENE)) {
<<<<<<< import ENV from '../../env.json' ======= import ENV from '../../env.json' import {makeCoreContext} from '../util/makeContext.js' >>>>>>> import ENV from '../../env.json' import {makeCoreContext} from '../util/makeContext.js' <<<<<<< const {AIRBITZ_API_KEY, SHAPESHIFT_API_KEY} = ENV ======= >>>>>>>
<<<<<<< import * as Constants from '../../../../constants/indexConstants' import type { AbcTransaction, AbcParsedUri } from 'airbitz-core-types' import type {Action} from '../../../ReduxTypes.js' export type SendConfirmationState = { transaction: AbcTransaction | null, parsedUri: AbcParsedUri, error: Error | null, displayAmount: number, publicAddress: string, feeSatoshi: number, label: string, // fee: string, feeSetting: string, inputCurrencySelected: string, maxSatoshi: number, isPinEnabled: boolean, isSliderLocked: boolean, draftStatus: string, isKeyboardVisible: boolean, pending: boolean } export const initialState: SendConfirmationState = { transaction: null, parsedUri: { publicAddress: '', nativeAmount: '' }, error: null, displayAmount: 0, publicAddress: '', feeSatoshi: 0, label: '', // fee: '', feeSetting: Constants.STANDARD_FEE, inputCurrencySelected: 'fiat', maxSatoshi: 0, isPinEnabled: false, isSliderLocked: false, draftStatus: 'under', isKeyboardVisible: false, pending: false } ======= import { type SendConfirmationState, initialState } from './selectors' import { isEqual } from 'lodash' >>>>>>> import { type SendConfirmationState, initialState } from './selectors' import { isEqual } from 'lodash' import type {Action} from '../../../ReduxTypes.js' <<<<<<< case ACTION.UPDATE_NATIVE_AMOUNT: { const { nativeAmount } = data return { ...state, parsedUri: { ...state.parsedUri, nativeAmount } } } case ACTION.CHANGE_MINING_FEE: { const { feeSetting } = data return { ...state, // fee: action.fee, feeSetting: feeSetting } } ======= >>>>>>>
<<<<<<< let cryptoAmountString let renderableTransactionList = transactions.sort(function (a: any, b: any) { ======= // console.log('about to render txList, this is: ', this) let cryptoBalanceString const renderableTransactionList = transactions.sort(function (a: any, b: any) { >>>>>>> const renderableTransactionList = transactions.sort(function (a: any, b: any) {
<<<<<<< <Scene key='scan_notused' renderTitle={this.renderWalletListNavBar} component={Scan} onEnter={this.props.dispatchEnableScan} onExit={this.props.dispatchDisableScan} onRight={() => Actions.drawerOpen()} rightButtonImage={MenuIcon} tabBarLabel='Send' title='Send' animation={'fade'} duration={600} /> ======= <Scene key='scan_notused' renderTitle={this.renderWalletListNavBar} component={Scan} onRight={() => Actions.drawerOpen()} rightButtonImage={MenuIcon} renderLeftButton={() => <HelpButton/>} tabBarLabel='Send' title='Send' animation={'fade'} duration={600} /> >>>>>>> <Scene key='scan_notused' renderTitle={this.renderWalletListNavBar} component={Scan} onRight={() => Actions.drawerOpen()} rightButtonImage={MenuIcon} onEnter={this.props.dispatchEnableScan} onExit={this.props.dispatchDisableScan} renderLeftButton={() => <HelpButton/>} tabBarLabel='Send' title='Send' animation={'fade'} duration={600} />
<<<<<<< import Contacts from 'react-native-contacts' import {colors as c} from '../../../../theme/variables/airbitz' ======= >>>>>>> <<<<<<< constructor(props) { super(props) console.log('Constructor of TransactionDetails, this.props is: ', this.props) const direction = (this.props.tx.amountSatoshi >= 0) ? 'receive' : 'send' const dateTime = new Date(this.props.tx.date * 1000) const dateString = dateTime.toLocaleDateString('en-US', {month: 'short', day: '2-digit', year: 'numeric'}) const timeString = dateTime.toLocaleTimeString('en-US', {hour: 'numeric', minute: 'numeric', second: 'numeric'}) this.state = { tx: this.props.tx, //payee: this.props.tx.metaData.payee ? this.props.tx.metaData.payee : '', direction, txid : this.props.tx.txid, payeeName: this.props.tx.payeeName, // remove commenting once metaData in Redux category: this.props.tx.category, notes: this.props.tx.notes, amountFiat: this.props.tx.amountFiat || '3.56', bizId: this.props.tx.bizId || 12345, miscJson: this.props.tx.miscJson || null, dateTimeSyntax: dateString + ' ' + timeString } } ======= constructor (props) { super(props) console.log('Constructor of TransactionDetails, this.props is: ', this.props) const direction = (this.props.tx.amountSatoshi >= 0) ? 'receive' : 'send' this.state = { tx: this.props.tx, // payee: this.props.tx.metaData.payee ? this.props.tx.metaData.payee : '', direction, txid: this.props.tx.txid, payeeName: this.props.tx.payeeName || 'payeeName', // remove commenting once metaData in Redux category: this.props.tx.category || 'fakeCategory', notes: this.props.tx.notes || 'fake notes', amountFiat: this.props.tx.amountFiat || '3.56', bizId: this.props.tx.bizId || 12345, miscJson: this.props.tx.miscJson || null } } >>>>>>> constructor (props) { super(props) const direction = (this.props.tx.amountSatoshi >= 0) ? 'receive' : 'send' const dateTime = new Date(this.props.tx.date * 1000) const dateString = dateTime.toLocaleDateString('en-US', {month: 'short', day: '2-digit', year: 'numeric'}) const timeString = dateTime.toLocaleTimeString('en-US', {hour: 'numeric', minute: 'numeric', second: 'numeric'}) this.state = { tx: this.props.tx, // payee: this.props.tx.metaData.payee ? this.props.tx.metaData.payee : '', direction, txid: this.props.tx.txid, payeeName: this.props.tx.payeeName, // remove commenting once metaData in Redux category: this.props.tx.category, notes: this.props.tx.notes, amountFiat: this.props.tx.amountFiat || '3.56', bizId: this.props.tx.bizId || 12345, miscJson: this.props.tx.miscJson || null, dateTimeSyntax: dateString + ' ' + timeString } } <<<<<<< <ScrollView overScrollMode='never' /* alwaysBounceVertical={false}*/ bounces={false} > <View style={[b(), styles.container]}> <View> <LinearGradient start={{x:0,y:0}} end={{x:1, y:0}} style={[b(), styles.expandedHeader, b()]} colors={["#3b7adb","#2b569a"]}> <PayeeIcon direction={this.state.direction} /> </LinearGradient> </View> <View style={[styles.dataArea]}> <View style={[styles.payeeNameArea]}> <View style={[styles.payeeNameWrap, b()]}> <TextInput autoCapitalize='none' autoCorrect={false} onChangeText={this.onChangePayee} style={[styles.payeeNameInput, b()]} placeholder='Payee' defaultValue={this.props.payeeName} /> </View> <View style={styles.payeeSeperator}> </View> <View style={[styles.dateWrap]}> <T style={[styles.date]}>{this.state.dateTimeSyntax}</T> </View> ======= <ScrollView overScrollMode='never' /* alwaysBounceVertical={false} */ > <View style={[b(), styles.container]}> <View> <LinearGradient start={{x: 0, y: 0}} end={{x: 1, y: 0}} style={[b(), styles.expandedHeader, b()]} colors={['#3b7adb', '#2b569a']}> <PayeeIcon direction={this.state.direction} /> </LinearGradient> </View> <View style={[styles.dataArea]}> <View style={[styles.payeeNameArea]}> <View style={[styles.payeeNameWrap]}> <TextInput onChangeText={this.onChangePayee} style={[styles.payeeNameInput, b()]} defaultValue={this.props.payeeName || 'Payee'} /> </View> <View style={[styles.dateWrap]}> <T style={[styles.date]}>{this.props.tx.date}</T> >>>>>>> <ScrollView overScrollMode='never' /* alwaysBounceVertical={false} */ bounces={false} > <View style={[b(), styles.container]}> <View> <LinearGradient start={{x: 0, y: 0}} end={{x: 1, y: 0}} style={[b(), styles.expandedHeader, b()]} colors={['#3b7adb', '#2b569a']}> <PayeeIcon direction={this.state.direction} /> </LinearGradient> </View> <View style={[styles.dataArea]}> <View style={[styles.payeeNameArea]}> <View style={[styles.payeeNameWrap, b()]}> <TextInput autoCapitalize='none' autoCorrect={false} onChangeText={this.onChangePayee} style={[styles.payeeNameInput, b()]} placeholder='Payee' defaultValue={this.props.payeeName} /> </View> <View style={styles.payeeSeperator} /> <View style={[styles.dateWrap]}> <T style={[styles.date]}>{this.state.dateTimeSyntax}</T> <<<<<<< <TextInput autoCapitalize='none' autoCorrect={false} onChangeText={this.props.onChangeFiatFxn} style={[styles.editableFiat]} keyboardType='numeric' placeholder={'Notes'} defaultValue={this.props.info.amountFiat || '' } /> ======= <TextInput onChangeText={this.props.onChangeFiatFxn} style={[styles.editableFiat]} keyboardType='numeric' defaultValue={this.props.info.amountFiat || ''} /> >>>>>>> <TextInput autoCapitalize='none' autoCorrect={false} onChangeText={this.props.onChangeFiatFxn} style={[styles.editableFiat]} keyboardType='numeric' placeholder={'Notes'} defaultValue={this.props.info.amountFiat || ''} /> <<<<<<< <TextInput onChangeText={this.props.onChangeCategoryFxn} style={[b(), styles.categoryInput]} defaultValue={this.props.info.category || ''} placeholder='Category' autoCapitalize='none' autoCorrect={false} /> </View> ======= <TextInput onChangeText={this.props.onChangeCategoryFxn} style={[b(), styles.categoryInput]} defaultValue={this.props.info.category || 'myCategory'} placeholder='Monthly exchange' /> </View> >>>>>>> <TextInput onChangeText={this.props.onChangeCategoryFxn} style={[b(), styles.categoryInput]} defaultValue={this.props.info.category || ''} placeholder='Category' autoCapitalize='none' autoCorrect={false} /> </View> <<<<<<< <TextInput onChangeText={this.props.onChangeNotesFxn} numberOfLines={3} multiline={true} defaultValue={this.props.info.notes || ''} style={[styles.notesInput]} placeholderTextColor={'#CCCCCC'} placeholder='Notes' autoCapitalize='none' autoCorrect={false} /> ======= <TextInput onChangeText={this.props.onChangeNotesFxn} numberOfLines={3} multiline defaultValue={this.props.info.notes || ''} style={[styles.notesInput]} placeholderTextColor={'#CCCCCC'} placeholder='Notes' /> >>>>>>> <TextInput onChangeText={this.props.onChangeNotesFxn} numberOfLines={3} defaultValue={this.props.info.notes || ''} style={[styles.notesInput]} placeholderTextColor={'#CCCCCC'} placeholder='Notes' autoCapitalize='none' autoCorrect={false} /> <<<<<<< let iconBgColor = (this.props.direction === 'receive') ? c.accentGreen : c.secondary return( <View style={[styles.modalHeaderIconWrapBottom]}> <View style={[styles.modalHeaderIconWrapTop, b()]}> {this.renderIcon()} </View> ======= let iconBgColor = (this.props.direction === 'receive') ? '#7FC343' : '#4977BB' return ( <View style={[styles.modalHeaderIconWrapBottom, {backgroundColor: iconBgColor}]}> <View style={[styles.modalHeaderIconWrapTop, b('purple')]}> {this.renderIcon()} >>>>>>> return ( <View style={[styles.modalHeaderIconWrapBottom]}> <View style={[styles.modalHeaderIconWrapTop, b()]}> {this.renderIcon()} <<<<<<< let iconBgColor = (this.props.direction === 'receive') ? c.accentGreen : c.secondary if (this.props.direction === 'receive'){ return( <Image source={ReceivedIcon} style={styles.payeeIcon} /> ======= let iconBgColor = (this.props.direction === 'receive') ? '#7FC343' : '#4977BB' if (this.props.direction === 'receive') { return ( <Ionicon name='ios-arrow-round-down' color={iconBgColor} size={44} style={[styles.payeeIcon]} /> >>>>>>> if (this.props.direction === 'receive') { return ( <Image source={ReceivedIcon} style={styles.payeeIcon} /> <<<<<<< return( <Image source={SentIcon} style={styles.payeeIcon} /> ======= return ( <Ionicon name='ios-arrow-round-up' color={iconBgColor} size={44} style={[styles.payeeIcon]} /> >>>>>>> return ( <Image source={SentIcon} style={styles.payeeIcon} />
<<<<<<< const EXCHANGE_RATE_LOADING_TEXT = strings.enUS['drawer_exchange_rate_loading'] export default class ExchangeRate extends Component { ======= export default class ExchangeRate extends Component<$FlowFixMeProps> { >>>>>>> const EXCHANGE_RATE_LOADING_TEXT = strings.enUS['drawer_exchange_rate_loading'] export default class ExchangeRate extends Component<$FlowFixMeProps> {
<<<<<<< ======= keyboardDidShow = () => { if (this.refs.loginUsername._textInput.isFocused()) this.props.dispatch(openUserList()) } keyboardDidHide = () => { this.props.dispatch(closeUserList()) } componentWillMount () { this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this.keyboardDidShow.bind(this)) this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this.keyboardDidHide.bind(this)) } componentWillUnmount () { this.keyboardDidShowListener.remove() this.keyboardDidHideListener.remove() } >>>>>>> <<<<<<< const cUsers = () => { ======= var cUsers = function () { >>>>>>> const cUsers = () => { <<<<<<< <View style={style.container}> <View style={style.form}> <InputGroup borderType='regular' style={style.inputGroup} > <Input ref='loginUsername' placeholder={t('fragment_landing_username_hint')} style={style.input} onChangeText={this.changeUsername} value={this.props.username} returnKeyType={'next'} onSubmitEditing={e => this.refs.password._textInput.focus()} selectTextOnFocus onFocus={this.showCachedUsers} ======= <View style={style.container}> <View style={style.form}> <InputGroup borderType='regular' style={style.inputGroup} > <Input ref='loginUsername' placeholder={t('fragment_landing_username_hint')} style={style.input} onChangeText={this.changeUsername} value={this.props.username} returnKeyType={'next'} onSubmitEditing={e => this.refs.password._textInput.focus()} selectTextOnFocus onFocus={this.showCachedUsers} >>>>>>> <View style={style.container}> <View style={style.form}> <InputGroup borderType='regular' style={style.inputGroup} > <Input ref='loginUsername' placeholder={t('fragment_landing_username_hint')} style={style.input} onChangeText={this.changeUsername} value={this.props.username} returnKeyType={'next'} onSubmitEditing={e => this.refs.password._textInput.focus()} selectTextOnFocus onFocus={this.showCachedUsers}
<<<<<<< ======= import { loginWithPassword } from './Login.middleware' import { removeUserToLogin } from '../CachedUsers/CachedUsers.action' >>>>>>> import { loginWithPassword } from './Login.middleware' import { removeUserToLogin } from '../CachedUsers/CachedUsers.action' <<<<<<< this.props.dispatch(closeLoginUsingPin()) this.props.dispatch(openLogin()) ======= this.props.dispatch(removeUserToLogin()) this.props.dispatch(openLogin()) >>>>>>> this.props.dispatch(removeUserToLogin()) this.props.dispatch(openLogin()) <<<<<<< pin: state.login.pin ======= pin : state.login.pin, user : state.cachedUsers.users.find( user => user.id === state.cachedUsers.selectedUserToLogin) >>>>>>> container: { flexDirection: 'column', alignItems: 'center', justifyContent: 'center', marginHorizontal: 30, width: width * 0.6, marginVertical: 15 }, inputGroup: { marginVertical: 30, backgroundColor: 'rgba(0,0,0,0.5)' }, input: { textAlign: 'center', color: '#FFF' }, text: { fontSize: 15, color: '#CCC' } }) export default connect(state => ({ pin : state.login.pin, user : state.cachedUsers.users.find( user => user.id === state.cachedUsers.selectedUserToLogin)
<<<<<<< settings_button_password_recovery: 'Password Recovery', ======= >>>>>>> settings_button_password_recovery: 'Password Recovery', <<<<<<< string_search: 'Search', // OTP title_otp_enabled: '2FA is enabled', title_otp_disabled: 'Protect your account with 2FA', otp_description: '2FA prevents unauthorized access from other devices, even if your username and password is compromised. You can scan a QR code or type in an authentication code to seamlessly authorize other devices', otp_enabled_description: 'You can scan a QR code or type in the authentication code to seamlessly authorize other devices.', otp_show_code: 'Show authentication code', otp_hide_code: 'Hide authentication code', otp_disable: 'Disable 2FA', otp_enable: 'Enable 2FA', otp_enabled_modal_part_one: '2fa has been enabled. A unique authentication code will be generated. ', otp_enabled_modal_part_two: 'If you lose your phone or uninstall the app, it will take 7 days to disable 2FA and access your account from another device without the authentication code', otp_disabled_modal: '2FA has been disabled. You can enable it again by tapping on "Enable 2FA" at any time.', otp_modal_headline: 'Are you sure you want to disable 2FA?', otp_modal_body: '2FA is recommended to keep your device secure from unauthorized access from other devices.' ======= string_search: 'Search' >>>>>>> string_search: 'Search', // OTP title_otp_enabled: '2FA is enabled', title_otp_disabled: 'Protect your account with 2FA', otp_description: '2FA prevents unauthorized access from other devices, even if your username and password is compromised. You can scan a QR code or type in an authentication code to seamlessly authorize other devices', otp_enabled_description: 'You can scan a QR code or type in the authentication code to seamlessly authorize other devices.', otp_show_code: 'Show authentication code', otp_hide_code: 'Hide authentication code', otp_disable: 'Disable 2FA', otp_enable: 'Enable 2FA', otp_enabled_modal_part_one: '2fa has been enabled. A unique authentication code will be generated. ', otp_enabled_modal_part_two: 'If you lose your phone or uninstall the app, it will take 7 days to disable 2FA and access your account from another device without the authentication code', otp_disabled_modal: '2FA has been disabled. You can enable it again by tapping on "Enable 2FA" at any time.', otp_modal_headline: 'Are you sure you want to disable 2FA?', otp_modal_body: '2FA is recommended to keep your device secure from unauthorized access from other devices.'
<<<<<<< nonPasswordDaysLimit: 4, nonPasswordLoginsLimit: 4 } ======= nonPasswordDaysLimit: 2, nonPasswordLoginsLimit: 2 }, isAccountBalanceVisible: true >>>>>>> nonPasswordDaysLimit: 4, nonPasswordLoginsLimit: 4 }, isAccountBalanceVisible: true
<<<<<<< index: index + 1, pageCount: groups.length ======= index: index + 1, prefix: post >>>>>>> index: index + 1, pageCount: groups.length prefix: post
<<<<<<< renderTextInput: PropTypes.func, flatListProps: PropTypes.object ======= renderTextInput: PropTypes.func, /** * `rowHasChanged` will be used for data objects comparison for dataSource */ rowHasChanged: PropTypes.func >>>>>>> renderTextInput: PropTypes.func, flatListProps: PropTypes.object <<<<<<< renderTextInput: props => <TextInput {...props} />, flatListProps: {} ======= renderTextInput: props => <TextInput {...props} />, rowHasChanged: (r1, r2) => r1 !== r2 >>>>>>> renderTextInput: props => <TextInput {...props} />, flatListProps: {} <<<<<<< const { data } = this.state; const { listStyle, renderItem, keyExtractor, renderSeparator, keyboardShouldPersistTaps, flatListProps } = this.props; ======= const { dataSource } = this.state; const { listStyle, renderItem, renderSeparator, keyboardShouldPersistTaps, onEndReached, onEndReachedThreshold } = this.props; >>>>>>> const { data } = this.state; const { listStyle, renderItem, keyExtractor, renderSeparator, keyboardShouldPersistTaps, flatListProps onEndReached, onEndReachedThreshold } = this.props;
<<<<<<< },{"../source/gist":53,"../source/github":54,"clone":5,"xtend":32}],39:[function(require,module,exports){ var qs = require('../lib/querystring'); ======= },{"../source/gist":55,"../source/github":56,"clone":5,"xtend":32}],39:[function(require,module,exports){ >>>>>>> },{"../source/gist":55,"../source/github":56,"clone":5,"xtend":32}],39:[function(require,module,exports){ var qs = require('../lib/querystring'); <<<<<<< },{"./core/data":38,"./core/loader":39,"./core/recovery":40,"./core/router":41,"./core/user":42,"./ui":55,"./ui/map":63,"store":14}],44:[function(require,module,exports){ ======= },{"./core/data":38,"./core/loader":39,"./core/recovery":40,"./core/router":41,"./core/user":42,"./ui":57,"./ui/map":64,"store":14}],44:[function(require,module,exports){ >>>>>>> },{"./core/data":38,"./core/loader":39,"./core/recovery":40,"./core/router":41,"./core/user":42,"./ui":57,"./ui/map":64,"store":14}],44:[function(require,module,exports){ <<<<<<< },{"../lib/validate":50,"../ui/saver.js":66}],52:[function(require,module,exports){ ======= },{"../lib/validate":52,"../ui/saver.js":67}],54:[function(require,module,exports){ >>>>>>> },{"../lib/validate":52,"../ui/saver.js":67}],54:[function(require,module,exports){ <<<<<<< },{"./ui/dnd":57,"./ui/file_bar":58,"./ui/layer_switch":62,"./ui/mode_buttons":65,"./ui/user":69}],56:[function(require,module,exports){ ======= },{"./ui/dnd":59,"./ui/file_bar":60,"./ui/layer_switch":63,"./ui/mode_buttons":66,"./ui/user":70}],58:[function(require,module,exports){ >>>>>>> },{"./ui/dnd":59,"./ui/file_bar":60,"./ui/layer_switch":63,"./ui/mode_buttons":66,"./ui/user":70}],58:[function(require,module,exports){ <<<<<<< },{"../ui/saver.js":66,"./share":67,"./source.js":68}],59:[function(require,module,exports){ ======= },{"../ui/saver.js":67,"./share":68,"./source.js":69}],61:[function(require,module,exports){ >>>>>>> },{"../ui/saver.js":67,"./share":68,"./source.js":69}],61:[function(require,module,exports){ <<<<<<< },{"./message":64}],60:[function(require,module,exports){ ======= },{"./message":65}],62:[function(require,module,exports){ >>>>>>> },{"./message":65}],62:[function(require,module,exports){ <<<<<<< },{}],63:[function(require,module,exports){ ======= },{}],64:[function(require,module,exports){ >>>>>>> },{}],64:[function(require,module,exports){ <<<<<<< },{"../lib/custom_hash.js":44,"../lib/popup":45,"../lib/querystring.js":47}],64:[function(require,module,exports){ ======= },{"../lib/custom_hash.js":44,"../lib/popup":47,"../lib/querystring.js":49}],65:[function(require,module,exports){ >>>>>>> },{"../lib/custom_hash.js":44,"../lib/popup":47,"../lib/querystring.js":49}],65:[function(require,module,exports){ <<<<<<< },{"../panel/json":51,"../panel/table":52}],66:[function(require,module,exports){ ======= },{"../panel/json":53,"../panel/table":54}],67:[function(require,module,exports){ >>>>>>> },{"../panel/json":53,"../panel/table":54}],67:[function(require,module,exports){ <<<<<<< },{"./commit":56,"./flash":59}],67:[function(require,module,exports){ ======= },{"./commit":58,"./flash":61}],68:[function(require,module,exports){ >>>>>>> },{"./commit":58,"./flash":61}],68:[function(require,module,exports){ <<<<<<< },{"../source/gist":53}],68:[function(require,module,exports){ ======= },{"../source/gist":55}],69:[function(require,module,exports){ >>>>>>> },{"../source/gist":55}],69:[function(require,module,exports){ <<<<<<< },{"./import":61,"detect-json-indent":7,"github-file-browser":10}],69:[function(require,module,exports){ ======= },{"./import":45,"detect-json-indent":7,"github-file-browser":10}],70:[function(require,module,exports){ >>>>>>> },{"./import":45,"detect-json-indent":7,"github-file-browser":10}],70:[function(require,module,exports){ <<<<<<< },{}],"topojson":[function(require,module,exports){ module.exports=require('PBmiWO'); },{}]},{},[43,53]) ======= },{}]},{},[55,43]) >>>>>>> },{}]},{},[55,43])
<<<<<<< return Promise.resolve({ ======= if (data instanceof Array) { data = { list: data, } } return { >>>>>>> if (data instanceof Array) { data = { list: data, } } return Promise.resolve({
<<<<<<< this.crawler.respectRobotsTxt = true; this.crawler.initialPath = '/'; ======= if (this.uri.pathname) { this.crawler.initialPath = this.uri.pathname; } >>>>>>> this.crawler.initialPath = '/'; if (this.uri.pathname) { this.crawler.initialPath = this.uri.pathname; }
<<<<<<< var expected = 'https://raw.githubusercontent.com/wiki/adamburmister/gitprint.com/home.md' urlHelper.translate(gitprintUrl).should.equal(expected); ======= var expected = 'https://raw.github.com/wiki/adamburmister/gitprint.com/home.md' verifyGithubUrlValid(expected, function() { urlHelper.translate(gitprintUrl).should.equal(expected); }); >>>>>>> var expected = 'https://raw.githubusercontent.com/wiki/adamburmister/gitprint.com/home.md' verifyGithubUrlValid(expected, function() { urlHelper.translate(gitprintUrl).should.equal(expected); }); <<<<<<< var expected = 'https://raw.githubusercontent.com/wiki/adamburmister/gitprint.com/home.md' urlHelper.translate(gitprintUrl).should.equal(expected); ======= var expected = 'https://raw.github.com/wiki/adamburmister/gitprint.com/home.md' verifyGithubUrlValid(expected, function() { urlHelper.translate(gitprintUrl).should.equal(expected); }); >>>>>>> var expected = 'https://raw.githubusercontent.com/wiki/adamburmister/gitprint.com/home.md' verifyGithubUrlValid(expected, function() { urlHelper.translate(gitprintUrl).should.equal(expected); }); <<<<<<< var expected = 'https://raw.githubusercontent.com/wiki/adamburmister/gitprint.com/Contribute.md' urlHelper.translate(gitprintUrl).should.equal(expected); ======= var expected = 'https://raw.github.com/wiki/adamburmister/gitprint.com/Contribute.md' verifyGithubUrlValid(expected, function() { urlHelper.translate(gitprintUrl).should.equal(expected); }); >>>>>>> var expected = 'https://raw.githubusercontent.com/wiki/adamburmister/gitprint.com/Contribute.md' verifyGithubUrlValid(expected, function() { urlHelper.translate(gitprintUrl).should.equal(expected); });
<<<<<<< define('text!templates/mentions/mention_item.html',[],function () { return '<div class="group-chat-title-wrap hidden">\n <div class="account-indicator"></div>\n <div class="contact-icon">\n <img class="server-icon hidden" src="./images/[email protected]">\n <img class="group-chat-icon hidden" src="./images/[email protected]">\n </div>\n <div class="group-chat-name one-line"></div>\n</div>\n<div class="mention-info-wrap">\n<div class="account-indicator ground-color-700"></div>\n<div class="circle-avatar"></div>\n<div class="mention-info">\n <div class="chat-title-wrap">\n <p class="chat-title one-line"></p>\n </div>\n <p class="last-msg one-line"></p>\n <p class="last-msg-date"></p>\n <span class="msg-counter hidden"></span>\n</div>\n</div>';}); ======= define('text!templates/mentions/mention_item.html',[],function () { return '<div class="group-chat-title-wrap hidden">\n <div class="account-indicator ground-color-700"></div>\n <div class="contact-icon">\n <img class="group-chat-icon hidden" src="./images/[email protected]">\n <img class="server-icon hidden" src="./images/[email protected]">\n </div>\n <div class="group-chat-name one-line"></div>\n</div>\n<div class="mention-info-wrap">\n<div class="account-indicator ground-color-700"></div>\n<div class="circle-avatar"></div>\n<div class="mention-info">\n <div class="chat-title-wrap">\n <p class="chat-title one-line"></p>\n </div>\n <p class="last-msg one-line"></p>\n <p class="last-msg-date"></p>\n <span class="msg-counter hidden"></span>\n</div>\n</div>';}); >>>>>>> define('text!templates/mentions/mention_item.html',[],function () { return '<div class="group-chat-title-wrap hidden">\n <div class="account-indicator ground-color-700"></div>\n <div class="contact-icon">\n <img class="server-icon hidden" src="./images/[email protected]">\n <img class="group-chat-icon hidden" src="./images/[email protected]">\n </div>\n <div class="group-chat-name one-line"></div>\n</div>\n<div class="mention-info-wrap">\n<div class="account-indicator ground-color-700"></div>\n<div class="circle-avatar"></div>\n<div class="mention-info">\n <div class="chat-title-wrap">\n <p class="chat-title one-line"></p>\n </div>\n <p class="last-msg one-line"></p>\n <p class="last-msg-date"></p>\n <span class="msg-counter hidden"></span>\n</div>\n</div>';});
<<<<<<< current_call = $item.children('metadata[node="' + Strophe.NS.JINGLE_MSG + '"]').children('call'), ======= $group_metadata = $item.children('metadata[node="' + Strophe.NS.GROUP_CHAT + '"]'), current_call = $item.children('metadata[node="' + Strophe.NS.JINGLE_MSG + '"]').children('call'),//$sync_metadata.children('call'), >>>>>>> current_call = $item.children('metadata[node="' + Strophe.NS.JINGLE_MSG + '"]').children('call'), $group_metadata = $item.children('metadata[node="' + Strophe.NS.GROUP_CHAT + '"]'),
<<<<<<< ======= let $group_chat_info = $(presence).find('x[xmlns="'+Strophe.NS.GROUP_CHAT +'"]'); if ($group_chat_info.length > 0 && $group_chat_info.children().length) { this.set('full_jid', $presence.attr('from')); if (!this.get('group_chat')) { this.set('group_chat', true); this.account.chat_settings.updateGroupChatsList(this.get('jid'), this.get('group_chat')); } if (!this.details_view.child('participants')) { this.details_view = new xabber.GroupChatDetailsView({model: this}); } let group_chat_info = this.parseGroupInfo($(presence)), prev_group_info = this.get('group_info') || {}; if (this.details_view.isVisible() && group_chat_info.online_members_num != prev_group_info.online_members_num) this.trigger('update_participants'); _.extend(prev_group_info, group_chat_info); this.set('group_info', prev_group_info); if (!this.get('roster_name') && (group_chat_info.name !== this.get('name'))) this.set('name', group_chat_info.name); this.set({status: group_chat_info.status, status_updated: moment.now(), status_message: (group_chat_info.members_num + ' members, ' + group_chat_info.online_members_num + ' online')}); } >>>>>>> <<<<<<< let iq_set_status = $iq({to: this.contact.get('jid'), type: 'set'}) .c('query', {xmlns: Strophe.NS.GROUP_CHAT + '#status'}), ======= let iq_set_status = $iq({to: this.contact.get('full_jid') || this.contact.get('jid'), type: 'set'}) .c('query', {xmlns: Strophe.NS.GROUP_CHAT}), >>>>>>> let iq_set_status = $iq({to: this.contact.get('full_jid') || this.contact.get('jid'), type: 'set'}) .c('query', {xmlns: Strophe.NS.GROUP_CHAT + '#status'}),
<<<<<<< (this.account && this.account.domain === attrs.jid) && _.extend(attrs, {server: true, status: 'online'}); ======= if (attrs.resource) { attrs.full_jid = attrs.jid + '/' + attrs.resource; } /*else if (attrs.group_chat) { attrs.full_jid = attrs.jid + '/Group'; }*/ (this.account && this.account.domain === attrs.jid) && _.extend(attrs, {is_server: true, bot: true}); >>>>>>> if (attrs.resource) { attrs.full_jid = attrs.jid + '/' + attrs.resource; } /*else if (attrs.group_chat) { attrs.full_jid = attrs.jid + '/Group'; }*/ (this.account && this.account.domain === attrs.jid) && _.extend(attrs, {server: true, status: 'online'});
<<<<<<< this.account.last_msg_timestamp = Math.round($(iq).children(`query[xmlns="${Strophe.NS.SYNCHRONIZATION}"]`).attr('stamp')/1000); let last_chat_msg_id = $(iq).find('set last'), encrypted_retract_version = $(iq).find('query conversation[type="encrypted"]').first().children('metadata[node="' + Strophe.NS.REWRITE + '"]').children('retract').attr('version'), retract_version = $(iq).find('query conversation[type="chat"]').first().children('metadata[node="' + Strophe.NS.REWRITE + '"]').children('retract').attr('version'); ======= let sync_timestamp = Number($(iq).children(`query[xmlns="${Strophe.NS.SYNCHRONIZATION}"]`).attr('stamp')); this.account.last_msg_timestamp = Math.round(sync_timestamp/1000); this.account.set('last_sync', sync_timestamp); let last_chat_msg_id = $(iq).find('set last'); >>>>>>> let sync_timestamp = Number($(iq).children(`query[xmlns="${Strophe.NS.SYNCHRONIZATION}"]`).attr('stamp')); this.account.last_msg_timestamp = Math.round(sync_timestamp/1000); this.account.set('last_sync', sync_timestamp); let last_chat_msg_id = $(iq).find('set last'), encrypted_retract_version = $(iq).find('query conversation[type="encrypted"]').first().children('metadata[node="' + Strophe.NS.REWRITE + '"]').children('retract').attr('version'), retract_version = $(iq).find('query conversation[type="chat"]').first().children('metadata[node="' + Strophe.NS.REWRITE + '"]').children('retract').attr('version');
<<<<<<< callback && callback(); ======= options.model.trigger("database_opened"); >>>>>>> callback && callback(); options.model.trigger("database_opened");
<<<<<<< // message.set('state', constants.MSG_SENT); if (!this.contact.get('group_chat')&&(!this.account.server_features.find(feature => feature.get('var') === Strophe.NS.DELIVERY))) this.account.connection.ping.ping(this.account.get('jid'), function () { if (message.get('state') === constants.MSG_PENDING) message.set('state', constants.MSG_SENT); }.bind(this)); ======= message.set('state', constants.MSG_SENT); >>>>>>> if (!this.contact.get('group_chat')&&(!this.account.server_features.find(feature => feature.get('var') === Strophe.NS.DELIVERY))) this.account.connection.ping.ping(this.account.get('jid'), function () { if (message.get('state') === constants.MSG_PENDING) message.set('state', constants.MSG_SENT); }.bind(this)); <<<<<<< var forwarded_message = this.receiveChatMessage($forwarded_message[0], { forwarded: true, pinned_message: options.pinned_message, delay: $forwarded_delay }); ======= >>>>>>> <<<<<<< this.edit_message = null; ======= this.messages_action = ""; >>>>>>> this.edit_message = null; <<<<<<< setEditionMessage: function (message) { this.$('.fwd-messages-preview').showIf(this.edit_message); this.$('.fwd-messages-preview .msg-author').text('Edit message'); this.$('.fwd-messages-preview .msg-text').html(message); this.$('.fwd-messages-preview').emojify('.msg-text', {emoji_size: 18}); this.displaySaveButton(); xabber.chat_body.updateHeight(); // this.$('.input-message .rich-textarea').flushRichTextarea().text(message).updateRichTextarea(); // this.focusOnInput(); var emoji_node = message.emojify({tag_name: 'img'}), $textarea = this.$('.input-message .rich-textarea'); $textarea.flushRichTextarea(); window.document.execCommand('insertHTML', false, emoji_node); $textarea.updateRichTextarea(); this.focusOnInput(); }, setForwardedMessages: function (messages) { ======= setForwardedMessages: function (messages, messages_action) { >>>>>>> setEditionMessage: function (message) { this.$('.fwd-messages-preview').showIf(this.edit_message); this.$('.fwd-messages-preview .msg-author').text('Edit message'); this.$('.fwd-messages-preview .msg-text').html(message); this.$('.fwd-messages-preview').emojify('.msg-text', {emoji_size: 18}); this.displaySaveButton(); xabber.chat_body.updateHeight(); // this.$('.input-message .rich-textarea').flushRichTextarea().text(message).updateRichTextarea(); // this.focusOnInput(); var emoji_node = message.emojify({tag_name: 'img'}), $textarea = this.$('.input-message .rich-textarea'); $textarea.flushRichTextarea(); window.document.execCommand('insertHTML', false, emoji_node); $textarea.updateRichTextarea(); this.focusOnInput(); }, setForwardedMessages: function (messages) { <<<<<<< if (this.edit_message) { $rich_textarea.flushRichTextarea(); } this.edit_message = null; ======= this.messages_action = ""; >>>>>>> if (this.edit_message) { $rich_textarea.flushRichTextarea(); } this.edit_message = null;
<<<<<<< // see if there is a match on the cursor click let match = this.getMatch(cursor); if (match) { let widgetlink = document.getElementById('widget-links'); switch (match.type) { case 'vec4': case 'vec3': // Cleaning up the value we send to the WidgetColor let cleanNum = match.string.substr(4); cleanNum = cleanNum.replace(/[()]/g, ''); cleanNum = '[' + cleanNum + ']'; if (match.type === 'vec4') { ReactDOM.render(<WidgetColor display={true} cursor={cursor} match={match} value={cleanNum} shader={true} vec='vec4'/>, widgetlink); } else { ReactDOM.render(<WidgetColor display={true} cursor={cursor} match={match} value={cleanNum} shader={true} vec='vec3'/>, widgetlink); } break; case 'vec2': ReactDOM.render(<WidgetLinkVec2 display={true} cursor={cursor} match={match} value={match.string}/>, widgetlink); break; case 'number': ReactDOM.render(<WidgetLinkNumber display={true} cursor={cursor} match={match} value={match.string}/>, widgetlink); break; default: break; } ======= // see if there is a match on the cursor click let match = getMatch(cursor); if (match) { let widgetlink = document.getElementById('widget-links'); switch (match.type) { case 'vec3': // Cleaning up the value we send to the WidgetColor let cleanNum = match.string.substr(4); cleanNum = cleanNum.replace(/[()]/g, ''); cleanNum = '[' + cleanNum + ']'; ReactDOM.render(<WidgetColor display={true} cursor={cursor} match={match} value={cleanNum} shader={true}/>, widgetlink); break; case 'vec2': ReactDOM.render(<WidgetLinkVec2 display={true} cursor={cursor} match={match} value={match.string}/>, widgetlink); break; case 'number': ReactDOM.render(<WidgetLinkNumber display={true} cursor={cursor} match={match} value={match.string}/>, widgetlink); break; default: break; >>>>>>> // see if there is a match on the cursor click let match = getMatch(cursor); if (match) { let widgetlink = document.getElementById('widget-links'); switch (match.type) { case 'vec4': case 'vec3': // Cleaning up the value we send to the WidgetColor let cleanNum = match.string.substr(4); cleanNum = cleanNum.replace(/[()]/g, ''); cleanNum = '[' + cleanNum + ']'; if (match.type === 'vec4') { ReactDOM.render(<WidgetColor display={true} cursor={cursor} match={match} value={cleanNum} shader={true} vec='vec4'/>, widgetlink); } else { ReactDOM.render(<WidgetColor display={true} cursor={cursor} match={match} value={cleanNum} shader={true} vec='vec3'/>, widgetlink); } break; case 'vec2': ReactDOM.render(<WidgetLinkVec2 display={true} cursor={cursor} match={match} value={match.string}/>, widgetlink); break; case 'number': ReactDOM.render(<WidgetLinkNumber display={true} cursor={cursor} match={match} value={match.string}/>, widgetlink); break; default: break; <<<<<<< getMatch (cursor) { // Types are put in order of priority const types = [ { name: 'vec4', pattern: /vec4\([-|\d|.|,\s]*\)/g }, { name: 'vec3', pattern: /vec3\([-|\d|.|,\s]*\)/g }, { name: 'vec2', pattern: /vec2\([-|\d|.|,\s]*\)/g }, { name: 'number', pattern: /[-]?\d+\.\d+|\d+\.|\.\d+/g } ]; const line = editor.getLine(cursor.line); for (let type of types) { const matches = findAllMatches(type.pattern, line); // If there are matches, determine if the cursor is in one of them. // If so, return that widget type, otherwise, we test the next type // to see if it matches. for (let match of matches) { let val = match[0]; let len = val.length; let start = match.index; let end = match.index + len; if (cursor.ch >= start && cursor.ch <= end) { return { type: type.name, start: start, end: end, string: val }; } ======= function getMatch (cursor) { // Types are put in order of priority const types = [ // Disabling the color widget that used to appear together with vec3 // { // name: 'color', // pattern: /vec[3|4]\([\d|.|,\s]*\)/g // }, { name: 'vec3', pattern: /vec3\([-|\d|.|,\s]*\)/g }, { name: 'vec2', pattern: /vec2\([-|\d|.|,\s]*\)/g }, { name: 'number', pattern: /[-]?\d+\.\d+|\d+\.|\.\d+/g } ]; const line = editor.getLine(cursor.line); for (let type of types) { const matches = findAllMatches(type.pattern, line); // If there are matches, determine if the cursor is in one of them. // If so, return that widget type, otherwise, we test the next type // to see if it matches. for (let match of matches) { let val = match[0]; let len = val.length; let start = match.index; let end = match.index + len; if (cursor.ch >= start && cursor.ch <= end) { return { type: type.name, start: start, end: end, string: val }; >>>>>>> function getMatch (cursor) { // Types are put in order of priority const types = [ { name: 'vec4', pattern: /vec4\([-|\d|.|,\s]*\)/g }, { name: 'vec3', pattern: /vec3\([-|\d|.|,\s]*\)/g }, { name: 'vec2', pattern: /vec2\([-|\d|.|,\s]*\)/g }, { name: 'number', pattern: /[-]?\d+\.\d+|\d+\.|\.\d+/g } ]; const line = editor.getLine(cursor.line); for (let type of types) { const matches = findAllMatches(type.pattern, line); // If there are matches, determine if the cursor is in one of them. // If so, return that widget type, otherwise, we test the next type // to see if it matches. for (let match of matches) { let val = match[0]; let len = val.length; let start = match.index; let end = match.index + len; if (cursor.ch >= start && cursor.ch <= end) { return { type: type.name, start: start, end: end, string: val };
<<<<<<< }) test('Table updates correctly upon change of key prop', () => { // stateful container above const Parent = ({ headers, i }) => ( <Table key={i}> <Thead> <Tr> <Th>{headers[0]}</Th> <Th>{headers[1]}</Th> </Tr> </Thead> <Tbody> <Tr> <Td>item 1</Td> <Td>item 2</Td> </Tr> </Tbody> </Table> ) const headersA = ['alpha', 'beta'] const headersB = ['one', 'two'] // mount with initial headers const wrapper = mount(<Parent headers={headersA} i={1} />) expect(wrapper).toMatchSnapshot('headersA') // modify the headers by passing new prop, adjust key wrapper.setProps({ headers: headersB, i: 2 }) expect(wrapper).toMatchSnapshot('headersB') ======= }) test('Render table with only header and empty row', () => { let component = renderer.create( <Table> <Thead> <Tr> <Td>Test Column</Td> </Tr> </Thead> <Tbody> <Tr> </Tr> </Tbody> </Table> ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }) test('Render table with conditional column', () => { let component = renderer.create( <Table> <Thead> <Tr> {false && <Td>Test Header Column</Td>} </Tr> </Thead> <Tbody> <Tr> {false && <Td>Test Body Column</Td>} </Tr> </Tbody> </Table> ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }) test('Render table with conditional and unconditional column', () => { let component = renderer.create( <Table> <Thead> <Tr> <Td>C1</Td> {false && <Td>C2</Td>} <Td>C3</Td> </Tr> </Thead> <Tbody> <Tr> <Td>V1</Td> {false && <Td>V2</Td>} <Td>V3</Td> </Tr> </Tbody> </Table> ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }) test('Render table with more columns in body', () => { let component = renderer.create( <Table> <Thead> <Tr> <Td>C1</Td> {false && <Td>C2</Td>} <Td>C3</Td> </Tr> </Thead> <Tbody> <Tr> <Td>V1</Td> {false && <Td>V2</Td>} <Td>V3</Td> <Td>V4</Td> <Td>V5</Td> <Td>V6</Td> </Tr> </Tbody> </Table> ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }) test('Render table with more columns in header', () => { let component = renderer.create( <Table> <Thead> <Tr> <Td>C1</Td> {false && <Td>C2</Td>} <Td>C3</Td> <Td>C4</Td> <Td>C5</Td> <Td>C6</Td> </Tr> </Thead> <Tbody> <Tr> <Td>V1</Td> {false && <Td>V2</Td>} <Td>V3</Td> </Tr> </Tbody> </Table> ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); >>>>>>> }) test('Render table with only header and empty row', () => { let component = renderer.create( <Table> <Thead> <Tr> <Td>Test Column</Td> </Tr> </Thead> <Tbody> <Tr> </Tr> </Tbody> </Table> ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }) test('Render table with conditional column', () => { let component = renderer.create( <Table> <Thead> <Tr> {false && <Td>Test Header Column</Td>} </Tr> </Thead> <Tbody> <Tr> {false && <Td>Test Body Column</Td>} </Tr> </Tbody> </Table> ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }) test('Render table with conditional and unconditional column', () => { let component = renderer.create( <Table> <Thead> <Tr> <Td>C1</Td> {false && <Td>C2</Td>} <Td>C3</Td> </Tr> </Thead> <Tbody> <Tr> <Td>V1</Td> {false && <Td>V2</Td>} <Td>V3</Td> </Tr> </Tbody> </Table> ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }) test('Render table with more columns in body', () => { let component = renderer.create( <Table> <Thead> <Tr> <Td>C1</Td> {false && <Td>C2</Td>} <Td>C3</Td> </Tr> </Thead> <Tbody> <Tr> <Td>V1</Td> {false && <Td>V2</Td>} <Td>V3</Td> <Td>V4</Td> <Td>V5</Td> <Td>V6</Td> </Tr> </Tbody> </Table> ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }) test('Render table with more columns in header', () => { let component = renderer.create( <Table> <Thead> <Tr> <Td>C1</Td> {false && <Td>C2</Td>} <Td>C3</Td> <Td>C4</Td> <Td>C5</Td> <Td>C6</Td> </Tr> </Thead> <Tbody> <Tr> <Td>V1</Td> {false && <Td>V2</Td>} <Td>V3</Td> </Tr> </Tbody> </Table> ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }) test('Table updates correctly upon change of key prop', () => { // stateful container above const Parent = ({ headers, i }) => ( <Table key={i}> <Thead> <Tr> <Th>{headers[0]}</Th> <Th>{headers[1]}</Th> </Tr> </Thead> <Tbody> <Tr> <Td>item 1</Td> <Td>item 2</Td> </Tr> </Tbody> </Table> ) const headersA = ['alpha', 'beta'] const headersB = ['one', 'two'] // mount with initial headers const wrapper = mount(<Parent headers={headersA} i={1} />) expect(wrapper).toMatchSnapshot('headersA') // modify the headers by passing new prop, adjust key wrapper.setProps({ headers: headersB, i: 2 }) expect(wrapper).toMatchSnapshot('headersB')
<<<<<<< var $myaccount = $('.myaccount', 'body'), THIS = this, default_submodule = 'profile'; ======= var $myaccount = $('.myaccount', 'body'), $scrolling_ul = $('ul.nav.nav-list', $myaccount), nice_scrollbar = $scrolling_ul.getNiceScroll()[0] || $scrolling_ul.niceScroll({ cursorcolor:"#333", cursoropacitymin:0.5, hidecursordelay:1000 }); >>>>>>> var $myaccount = $('.myaccount', 'body'), THIS = this, default_submodule = 'profile'; $scrolling_ul = $('ul.nav.nav-list', $myaccount), nice_scrollbar = $scrolling_ul.getNiceScroll()[0] || $scrolling_ul.niceScroll({ cursorcolor:"#333", cursoropacitymin:0.5, hidecursordelay:1000 }); <<<<<<< winkstart.publish('myaccount.'+default_submodule+'.render', function() { THIS.click_submodule(default_submodule); $myaccount.slideDown(300).addClass('myaccount-open'); }); ======= nice_scrollbar.show(); $myaccount.slideDown(300, nice_scrollbar.resize).addClass('myaccount-open'); >>>>>>> winkstart.publish('myaccount.'+default_submodule+'.render', function() { THIS.click_submodule(default_submodule); nice_scrollbar.show(); $myaccount.slideDown(300, nice_scrollbar.resize).addClass('myaccount-open'); });
<<<<<<< 'monster-timezone': 'js/lib/monster.timezone', nicescroll: 'js/lib/jquery.nicescroll.min', ======= 'monster-util': 'js/lib/monster.util', >>>>>>> 'monster-timezone': 'js/lib/monster.timezone', 'monster-util': 'js/lib/monster.util', nicescroll: 'js/lib/jquery.nicescroll.min',
<<<<<<< self.searchAsYouType('upcoming', parent); }, formatUpcomingConferences: function(data) { var conferences = data.conferences; ======= parent .find('.right-content') .empty() .append(upcomingConfView); } }); }, formatUpcomingConferences: function(conferences) { var currentTimestamp = monster.util.dateToGregorian(new Date()), result = []; _.each(conferences, function(item) { if(item.start > currentTimestamp) { var timestamp = monster.util.toFriendlyDate(item.start, 'standard'); item.date = timestamp.match(/([0-9]+)\/([0-9]+)/)[0]; item.startTime = timestamp.match(/([0-9]+):([0-9]+)\s(AM|PM)/)[0]; result.push(item); } }); result.sort(function(a,b) { return a.start - b.start; }); return result; }, bindUpcomingConferencesEvents: function(parent, appContainer) { var self = this; parent.find('.header input').on('keyup', function() { var self = $(this), search = self.val(); if(search) { $.each(parent.find('tbody tr'), function() { var td= $(this).find('td:first-child'), val = $(this).data('name').toLowerCase(); console.log(val, $(this)); if(val.indexOf(search.toLowerCase()) >= 0) { $(this).show(); } else { $(this).hide(); } }); } else { parent.find('tbody tr').show(); } }); >>>>>>> self.searchAsYouType('upcoming', parent); parent .find('.right-content') .empty() .append(upcomingConfView); } }); }, formatUpcomingConferences: function(conferences) { var currentTimestamp = monster.util.dateToGregorian(new Date()), result = []; _.each(conferences, function(item) { if(item.start > currentTimestamp) { var timestamp = monster.util.toFriendlyDate(item.start, 'standard'); item.date = timestamp.match(/([0-9]+)\/([0-9]+)/)[0]; item.startTime = timestamp.match(/([0-9]+):([0-9]+)\s(AM|PM)/)[0]; result.push(item); } }); result.sort(function(a,b) { return a.start - b.start; }); return result; }, bindUpcomingConferencesEvents: function(parent, appContainer) { var self = this; parent.find('.header input').on('keyup', function() { var self = $(this), search = self.val(); if(search) { $.each(parent.find('tbody tr'), function() { var td= $(this).find('td:first-child'), val = $(this).data('name').toLowerCase(); console.log(val, $(this)); if(val.indexOf(search.toLowerCase()) >= 0) { $(this).show(); } else { $(this).hide(); } }); } else { parent.find('tbody tr').show(); } });
<<<<<<< function valueType (value) { const styles = ['none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset'] // 需要考虑到0px简写为0的情况,否则会当作color处理。 if (/px/ig.test(value) || parseInt(value) === 0 || value === 'none') { return 'width' } else if (~styles.indexOf(value)) { return 'style' } else { return 'color' } } function setStyle (direction, value, addDeclaration) { const values = value.split(' ') for (let i = 0, length = values.length; i < length; i++) { const borderProperty = `border-${direction}-${valueType(values[i])}` if (values[i] === 'none') { values[i] = '0' } if (/\S+style$/.test(borderProperty)) { addDeclaration('border-style', values[i]) } else { addDeclaration(borderProperty, values[i]) } } return 'I:' } export default { 'border': (value, declaration, addDeclaration) => { if (value === 'none') { declaration.value = 0 } return '' }, 'border-color': '', 'border-style': '', 'border-width': '', 'border-radius': (value, declaration, addDeclaration) => { // width也不支持百分数,后期在转换 if (~value.indexOf('%')) { // 其实应当按照当前组件的宽高为基准计算,但这里拿不到,暂时这样处理下。 value = 750 / 100 * parseInt(value) + 'px' declaration.value = value } }, 'border-top': (value, declaration, addDeclaration) => { return setStyle('top', value, addDeclaration) }, 'border-bottom': (value, declaration, addDeclaration) => { return setStyle('bottom', value, addDeclaration) }, 'border-left': (value, declaration, addDeclaration) => { return setStyle('left', value, addDeclaration) }, 'border-right': (value, declaration, addDeclaration) => { return setStyle('right', value, addDeclaration) }, 'border-left-width': '', 'border-right-width': '', 'border-top-width': '', 'border-bottom-width': '', 'border-left-color': '', 'border-right-color': '', 'border-top-color': '', 'border-bottom-color': '', 'border-left-radius': '', 'border-right-radius': '', 'border-top-radius': '', 'border-bottom-radius': '', 'border-top-style': 'I:', 'border-bottom-style': 'I:', 'border-left-style': 'I:', 'border-right-style': 'I:' } ======= function valueType (value) { const styles = ['none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset'] // 需要考虑到0px简写为0的情况,否则会当作color处理。 if (/px/ig.test(value) || parseInt(value) === 0) { return 'width' } else if (~styles.indexOf(value)) { return 'style' } else { return 'color' } } function setStyle (direction, value, addDeclaration) { const values = value.split(' ') for (let i = 0, length = values.length; i < length; i++) { const borderProperty = `border-${direction}-${valueType(values[i])}` if (/\S+style$/.test(borderProperty)) { addDeclaration('border-style', values[i]) } else { addDeclaration(borderProperty, values[i]) } } return 'I:' } function setWidth (value, declaration) { const styles = ['thin', 'medium', 'thick', 'inherit'] const values = ['1px', '2px', '3px', '1px'] var valueList = value.split(' ') value = valueList[0] if (~styles.indexOf(value)) { const index = styles.indexOf(value) console.log(index) value = values[index] } if (~value.indexOf('%')) { value = 750 / 100 * parseInt(value) + 'px' } declaration.value = value } export default { 'border': (value, declaration, addDeclaration) => { if (value === 'none') { declaration.value = 0 } return '' }, 'border-color': '', 'border-style': '', 'border-width': (value, declaration, addDeclaration) => { // width也不支持百分数,后期在转换 setWidth(value, declaration) }, 'border-radius': (value, declaration, addDeclaration) => { if (~value.indexOf('%')) { // 其实应当按照当前组件的宽高为基准计算,但这里拿不到,暂时这样处理下。 value = 750 / 100 * parseInt(value) + 'px' declaration.value = value } }, 'border-top': (value, declaration, addDeclaration) => { return setStyle('top', value, addDeclaration) }, 'border-bottom': (value, declaration, addDeclaration) => { return setStyle('bottom', value, addDeclaration) }, 'border-left': (value, declaration, addDeclaration) => { return setStyle('left', value, addDeclaration) }, 'border-right': (value, declaration, addDeclaration) => { return setStyle('right', value, addDeclaration) }, 'border-left-width': (value, declaration, addDeclaration) => { setWidth(value, declaration) }, 'border-right-width': (value, declaration, addDeclaration) => { setWidth(value, declaration) }, 'border-top-width': (value, declaration, addDeclaration) => { setWidth(value, declaration) }, 'border-bottom-width': (value, declaration, addDeclaration) => { setWidth(value, declaration) }, 'border-left-color': '', 'border-right-color': '', 'border-top-color': '', 'border-bottom-color': '', 'border-left-radius': '', 'border-right-radius': '', 'border-top-radius': '', 'border-bottom-radius': '', 'border-top-style': 'I:', 'border-bottom-style': 'I:', 'border-left-style': 'I:', 'border-right-style': 'I:' } >>>>>>> function valueType (value) { const styles = ['none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset'] // 需要考虑到0px简写为0的情况,否则会当作color处理。 if (/px/ig.test(value) || parseInt(value) === 0 || value === 'none') { return 'width' } else if (~styles.indexOf(value)) { return 'style' } else { return 'color' } } function setStyle (direction, value, addDeclaration) { const values = value.split(' ') for (let i = 0, length = values.length; i < length; i++) { const borderProperty = `border-${direction}-${valueType(values[i])}` if (values[i] === 'none') { values[i] = '0' } if (/\S+style$/.test(borderProperty)) { addDeclaration('border-style', values[i]) } else { addDeclaration(borderProperty, values[i]) } } return 'I:' } function setWidth (value, declaration) { const styles = ['thin', 'medium', 'thick', 'inherit'] const values = ['1px', '2px', '3px', '1px'] var valueList = value.split(' ') value = valueList[0] if (~styles.indexOf(value)) { const index = styles.indexOf(value) console.log(index) value = values[index] } if (~value.indexOf('%')) { value = 750 / 100 * parseInt(value) + 'px' } declaration.value = value } export default { 'border': (value, declaration, addDeclaration) => { if (value === 'none') { declaration.value = 0 } return '' }, 'border-color': '', 'border-style': '', 'border-width': (value, declaration, addDeclaration) => { // width也不支持百分数,后期在转换 setWidth(value, declaration) }, 'border-radius': (value, declaration, addDeclaration) => { // width也不支持百分数,后期在转换 if (~value.indexOf('%')) { // 其实应当按照当前组件的宽高为基准计算,但这里拿不到,暂时这样处理下。 value = 750 / 100 * parseInt(value) + 'px' declaration.value = value } }, 'border-top': (value, declaration, addDeclaration) => { return setStyle('top', value, addDeclaration) }, 'border-bottom': (value, declaration, addDeclaration) => { return setStyle('bottom', value, addDeclaration) }, 'border-left': (value, declaration, addDeclaration) => { return setStyle('left', value, addDeclaration) }, 'border-right': (value, declaration, addDeclaration) => { return setStyle('right', value, addDeclaration) }, 'border-left-width': (value, declaration, addDeclaration) => { setWidth(value, declaration) }, 'border-right-width': (value, declaration, addDeclaration) => { setWidth(value, declaration) }, 'border-top-width': (value, declaration, addDeclaration) => { setWidth(value, declaration) }, 'border-bottom-width': (value, declaration, addDeclaration) => { setWidth(value, declaration) }, 'border-left-color': '', 'border-right-color': '', 'border-top-color': '', 'border-bottom-color': '', 'border-left-radius': '', 'border-right-radius': '', 'border-top-radius': '', 'border-bottom-radius': '', 'border-top-style': 'I:', 'border-bottom-style': 'I:', 'border-left-style': 'I:', 'border-right-style': 'I:' }
<<<<<<< const listenTimeoutId = setTimeout(() => { if (sub) sub.unsubscribe(); reject( new TransportError(this.ErrorMessage_ListenTimeout, "ListenTimeout") ); }, listenTimeout); ======= >>>>>>>
<<<<<<< var isTag = modifier === 'tag'; var streamItems = data.payload.streamItems; var postMap = data.payload.references.Post, userMap = data.payload.references.User, collection = data.payload.references.Collection; ======= var items = []; >>>>>>> var items = []; <<<<<<< // get post when given tag if (isTag) { post = postMap[item.postPreview.postId]; // get post when given author (which has a postPreview prop) } else if (item.hasOwnProperty('postPreview')) { post = postMap[item.postPreview.postId]; // get post when browsing top (which has a bmPostPreview prop) } else if (item.hasOwnProperty('bmPostPreview')) { post = postMap[item.bmPostPreview.postId]; // ignore and don't count if it's not actually a post ======= // build stories array for (var i = 0, len = Math.min(count, items.length); i < len; i++) { item = items[i]; if (['tag', 'search'].indexOf(modifier) !== -1) { post = item; >>>>>>> // build stories array for (var i = 0, len = Math.min(count, items.length); i < len; i++) { item = items[i]; if (['tag', 'search'].indexOf(modifier) !== -1) { post = postMap[item.postPreview.postId]; <<<<<<< var user = userMap[post.creatorId]; var collectionRef; ======= user = userMap[post.creatorId]; >>>>>>> var user = userMap[post.creatorId]; var collectionRef; user = userMap[post.creatorId];
<<<<<<< server.plugins['hapi-sequelize']['shop'].sequelize.query('show tables', { type: Sequelize.QueryTypes.SELECT }).then((tables) => { expect(tables.length).to.equal(6); done(); }); }) }); test('plugin throws error when no models are found', { parallel: true }, (done) => { const server = new Hapi.Server(); server.connection(); const sequelize = new Sequelize('shop', 'root', '', { host: '127.0.0.1', port: 3306, dialect: 'mysql' }); server.register([ { register: require('../lib'), options: [ { name: 'foo', models: ['./foo/**/*.js'], sequelize: sequelize, sync: true, forceSync: true } ] } ], (err) => { expect(err).to.exist(); ======= expect(spy.getCall(0).args[0]).to.be.an.instanceOf(Sequelize); >>>>>>> expect(spy.getCall(0).args[0]).to.be.an.instanceOf(Sequelize); server.plugins['hapi-sequelize']['shop'].sequelize.query('show tables', { type: Sequelize.QueryTypes.SELECT }).then((tables) => { expect(tables.length).to.equal(6); done(); }); }) }); test('plugin throws error when no models are found', { parallel: true }, (done) => { const server = new Hapi.Server(); server.connection(); const sequelize = new Sequelize('shop', 'root', '', { host: '127.0.0.1', port: 3306, dialect: 'mysql' }); server.register([ { register: require('../lib'), options: [ { name: 'foo', models: ['./foo/**/*.js'], sequelize: sequelize, sync: true, forceSync: true } ] } ], (err) => { expect(err).to.exist();
<<<<<<< ======= // el.find('') >>>>>>>
<<<<<<< comment: "Hide commands (up, down, anarchy, etc)", isActive: true, ======= comment: "Commands (up, down, anarchy, etc)", def: true, >>>>>>> comment: "Commands (up, down, anarchy, etc)", isActive: true, <<<<<<< comment: "Hide messages with non-whitelisted URLs", isActive: true, ======= comment: "Non-whitelisted URLs", def: true, >>>>>>> comment: "Non-whitelisted URLs", isActive: true, <<<<<<< comment: "Hide duplicate URLS", isActive: true, ======= comment: "Duplicate URLS", def: true, >>>>>>> comment: "Duplicate URLS", isActive: true, <<<<<<< comment: "Hide dongers and ascii art. ヽ༼ຈل͜ຈ༽ノ", isActive: false, ======= comment: "Ascii art", def: false, >>>>>>> comment: "Ascii art. ヽ༼ຈل͜ຈ༽ノ", isActive: false, <<<<<<< comment: "Hide one-word messages (Kappa, \"yesss!\", etc)", isActive: false, ======= comment: "One-word messages", def: false, >>>>>>> comment: "One-word messages", isActive: false, <<<<<<< ======= { name: 'TppFilterUppercase', comment: "ALLCAPS", def: false, predicate: message_is_uppercase }, >>>>>>> <<<<<<< var panelTable = document.createElement("table"); controlPanel.appendChild(panelTable); all_options.forEach(function(option){ var tr = document.createElement("tr"); panelTable.appendChild(tr); var td; td = document.createElement("td"); var ipt = document.createElement("input"); ipt.type = "checkbox"; ipt.checked = option.isActive; // <--- td.appendChild(ipt); tr.appendChild(td); td = document.createElement("td"); td.appendChild(document.createTextNode(option.comment)); // <--- tr.appendChild(td); $(ipt).click(function(){ option.isActive = !option.isActive; update_chat_with_filter(); }); }); var controls = document.getElementById("controls"); document.body.appendChild(customStyles); //use a default jtv style for button so it looks natural and works with BetterTTV var toggleControlPanel = $("<div>", { style: "background-image: none !important; margin-bottom: 5px;", className: "dropdown_static" }); toggleControlPanel.text("Chat Filter Settings"); //create arrow using jtv styles/images var icon = $("<span>", {style: "background-image: url('../images/xarth/left_col_dropdown_arrow.png'); background-position: 50% -32px; height: 10px; margin-left: 10px; width: 10px; background-repeat: no-repeat; display: inline-block;"}); toggleControlPanel.append(icon); toggleControlPanel.click(function(){ $(controlPanel).toggleClass("hidden"); //flip arrow icon.css('background-position', (icon.css('background-position') == '50% -7px') ? '50% -32px' : '50% -7px' ); }); $(controls).append(toggleControlPanel); controls.appendChild(controlPanel); } ======= filters.forEach(function(filter){ $('#chat_filter_dropmenu').append('<p class="dropmenu_action" id="' + filter.name + '-p"><input type="checkbox" id="' + filter.name + '"> ' + filter.comment +'</p>'); $('#' + filter.name + '-p').on('click', function(){ $('#' + filter.name).prop('checked', !$('#' + filter.name).prop('checked')); }); $('#' + filter.name).on('change', function(){ chatList.toggleClass(filter.name); }).prop('checked', filter.def); if(filter.def) chatList.addClass(filter.name); }); $('#chat_filter_dropmenu').append('<p style="margin-left:6px;">GUI Options:</p>'); gui_options.forEach(function(gui_option){ $('#chat_filter_dropmenu').append('<p class="dropmenu_action" id="' + gui_option.name + '-p"><input type="checkbox" id="' + gui_option.name + '"> ' + gui_option.comment +'</p>'); $('#' + gui_option.name + '-p').on('click', function(){ $('#' + gui_option.name).prop('checked', !$('#' + gui_option.name).prop('checked')); }); $('#' + gui_option.name).on('change', function(){ chatList.toggleClass(gui_option.name); }).prop('checked', gui_option.def); if(gui_option.def) chatList.addClass(gui_option.name); }); }; >>>>>>> function add_option(option){ controlPanel .append('<p class="dropmenu_action"><label for="' + option.name + '"> <input type="checkbox" id="' + option.name + '">' + option.comment + '</label></p>'); $('#' + option.name) .prop('checked', option.isActive) .on('change', function(){ option.isActive = $(this).prop("checked"); update_chat_with_filter(); }); } filters.forEach(add_option); $('#chat_filter_dropmenu').append('<p style="margin-left:6px;">Automatically rewrite:</p>'); rewriters.forEach(add_option); }
<<<<<<< } else if (action === 'display') { controller.classList.add('vsc-manual'); controller.classList.toggle('vsc-hidden'); ======= } else if (action === 'drag') { handleDrag(v, controller); >>>>>>> } else if (action === 'display') { controller.classList.add('vsc-manual'); controller.classList.toggle('vsc-hidden'); } else if (action === 'drag') { handleDrag(v, controller);
<<<<<<< import { ChannelContext, EmojiContext } from '../../../context'; ======= import { ChannelContext, TranslationContext } from '../../../context'; >>>>>>> import { ChannelContext, EmojiContext, TranslationContext, } from '../../../context'; <<<<<<< <EmojiContext.Provider value={emojiMockConfig}> <MessageLivestream message={message} typing={false} {...props} /> </EmojiContext.Provider> ======= <TranslationContext.Provider value={{ t: (key) => key, tDateTimeParser: customDateTimeParser, userLanguage: 'en', }} > <MessageLivestream message={message} typing={false} {...props} /> </TranslationContext.Provider> >>>>>>> <EmojiContext.Provider value={emojiMockConfig}> <TranslationContext.Provider value={{ t: (key) => key, tDateTimeParser: customDateTimeParser, userLanguage: 'en', }} > <MessageLivestream message={message} typing={false} {...props} /> </TranslationContext.Provider> </EmojiContext.Provider>
<<<<<<< }; ======= }; if (params && params.rotate) this.rotateLabels = true; var allLabelsVisibleAttr = div.attr("data-idd-force-labels-visibility"); if(typeof allLabelsVisibleAttr !== 'undefined'){ if(allLabelsVisibleAttr == "false" || allLabelsVisibleAttr == "disable" || allLabelsVisibleAttr == "disabled") areAllLabelsVisibleAttr = false; } else areAllLabelsVisibleAttr = false; if(params === undefined) params = {} params["forceLabelsVisibility"] = areAllLabelsVisibleAttr >>>>>>> }; var allLabelsVisibleAttr = div.attr("data-idd-force-labels-visibility"); if(typeof allLabelsVisibleAttr !== 'undefined'){ if(allLabelsVisibleAttr == "false" || allLabelsVisibleAttr == "disable" || allLabelsVisibleAttr == "disabled") areAllLabelsVisibleAttr = false; } else areAllLabelsVisibleAttr = false; if(params === undefined) params = {} params["forceLabelsVisibility"] = areAllLabelsVisibleAttr
<<<<<<< function initLEDs() { var menItm = ` <tr><td width=1><input type=submit onclick="ShowHideEvent( 'LEDs' ); KickLEDs();" value="LEDs"></td><td> <div id=LEDs class="collapsible"> <table width=100% border=1><tr><td id=LEDCanvasHolder><CANVAS id=LEDCanvas width=512 height=100></CANVAS></td> <td><input type=button onclick="ToggleLEDPause();" id=LEDPauseButton value="|| / >"></td></tr></table> Select LEDs/Pattern: <input type=text id=LEDSelect value=1-4> <br> #LEDs: <input type=number min=0 value=4 id=LEDNum style="width:5.5em;"> <input type=color id=LEDColor> <input type=button value="Set Color" id=LEDCbtn> <input type=button value="Set Pattern" id=LEDPbtn> <input type=button value=Stop id=LEDSbtn> <input type=button value=Off id=LEDObtn> <p style="font-size:70%;font-style: italic"> Patterns can include individual LEDs or ranges of LEDs separated by commata, e.g. "1-3,7,20-35". You can select colors via the color-picker or by holding <kbd>Alt</kbd> and clicking a color inside the color display. Alternatively, colors can be appended to a range, e.g. "1-3#ffff00". Rages without an appended color use the last specified one. Ranges can be entered by hand or selected in the color-display with the usual <kbd>Shift</kbd>+<kbd>LeftClick</kbd> and <kbd>Alt</kbd>+<kbd>LeftClick</kbd> combinations. If you set a pattern, use a low positive integer. "#LEDs" is the total number of LEDs connected to the esp8266 and must be provided.</p> </div> </td></tr> `; $('#MainMenu > tbody:last').after( menItm ); KickLEDs(); } ======= >>>>>>> function initLEDs() { var menItm = ` <tr><td width=1><input type=submit onclick="ShowHideEvent( 'LEDs' ); KickLEDs();" value="LEDs"></td><td> <div id=LEDs class="collapsible"> <table width=100% border=1><tr><td id=LEDCanvasHolder><CANVAS id=LEDCanvas width=512 height=100></CANVAS></td> <td><input type=button onclick="ToggleLEDPause();" id=LEDPauseButton value="|| / >"></td></tr></table> Select LEDs/Pattern: <input type=text id=LEDSelect value=1-4> <br> #LEDs: <input type=number min=0 value=4 id=LEDNum style="width:5.5em;"> <input type=color id=LEDColor> <input type=button value="Set Color" id=LEDCbtn> <input type=button value="Set Pattern" id=LEDPbtn> <input type=button value=Stop id=LEDSbtn> <input type=button value=Off id=LEDObtn> <p style="font-size:70%;font-style: italic"> Patterns can include individual LEDs or ranges of LEDs separated by commata, e.g. "1-3,7,20-35". You can select colors via the color-picker or by holding <kbd>Alt</kbd> and clicking a color inside the color display. Alternatively, colors can be appended to a range, e.g. "1-3#ffff00". Rages without an appended color use the last specified one. Ranges can be entered by hand or selected in the color-display with the usual <kbd>Shift</kbd>+<kbd>LeftClick</kbd> and <kbd>Alt</kbd>+<kbd>LeftClick</kbd> combinations. If you set a pattern, use a low positive integer. "#LEDs" is the total number of LEDs connected to the esp8266 and must be provided.</p> </div> </td></tr> `; $('#MainMenu > tbody:last').after( menItm ); KickLEDs(); } <<<<<<< function strToByte(str, pos) { return parseInt(str.substr(pos, 2), 16); } function validateRange() { var obj = $('#LEDSelect'); var val = obj.val(); if( ! val.match(/^\d+(-\d+)?(#[a-zA-Z0-9]{6,6})?(,\d+(-\d+)?(#[a-zA-Z0-9]{6,6})?)*$/) ) { obj.css( "background-color", "#ff0000"); return false; } obj.css( "background-color", "#ffffff"); return val; } function SetPattern( ptrn ) { if( ! ptrn.match(/^\d+$/) ) { $('#LEDSelect').css( "background-color", "#ff0000"); return false; } var numLEDs = parseInt($('#LEDNum').val()); var color = document.getElementById('LEDColor').value; color = color.replace('#',''); $('#LEDSelect').css( "background-color", "#ffffff"); var qDat = new Uint8Array(ptrn==0 ? 8 : 5); var byte = 0; qDat[byte++] = "C".charCodeAt(); qDat[byte++] = "P".charCodeAt(); qDat[byte++] = parseInt(ptrn); qDat[byte++] = numLEDs>>8; qDat[byte++] = numLEDs%256; if( ptrn==0 ) { qDat[byte++] = strToByte(color, 0); qDat[byte++] = strToByte(color, 2); qDat[byte++] = strToByte(color, 4); } QueueOperation( qDat ); return true; } // Mostly setup stuff ======= >>>>>>> function strToByte(str, pos) { return parseInt(str.substr(pos, 2), 16); } function validateRange() { var obj = $('#LEDSelect'); var val = obj.val(); if( ! val.match(/^\d+(-\d+)?(#[a-zA-Z0-9]{6,6})?(,\d+(-\d+)?(#[a-zA-Z0-9]{6,6})?)*$/) ) { obj.css( "background-color", "#ff0000"); return false; } obj.css( "background-color", "#ffffff"); return val; } function SetPattern( ptrn ) { if( ! ptrn.match(/^\d+$/) ) { $('#LEDSelect').css( "background-color", "#ff0000"); return false; } var numLEDs = parseInt($('#LEDNum').val()); var color = document.getElementById('LEDColor').value; color = color.replace('#',''); $('#LEDSelect').css( "background-color", "#ffffff"); var qDat = new Uint8Array(ptrn==0 ? 8 : 5); var byte = 0; qDat[byte++] = "C".charCodeAt(); qDat[byte++] = "P".charCodeAt(); qDat[byte++] = parseInt(ptrn); qDat[byte++] = numLEDs>>8; qDat[byte++] = numLEDs%256; if( ptrn==0 ) { qDat[byte++] = strToByte(color, 0); qDat[byte++] = strToByte(color, 2); qDat[byte++] = strToByte(color, 4); } QueueOperation( qDat ); return true; } // Mostly setup stuff <<<<<<< nled = parseInt( $('#LEDNum').val() ); if( val<0 || val>512 || isNaN(val) ) nled = 4; $('#LEDNum').val(nled); }); // Select a pattern to be used continously $('#LEDPbtn').click( function(e) { var ptrn = $('#LEDSelect').val(); return SetPattern( ptrn ); }); // Stop LEDs from changing $('#LEDSbtn').click( function(e) { return SetPattern( '255' ); }); // Turn all LEDs to black $('#LEDObtn').click( function(e) { document.getElementById('LEDColor').value = '#000000'; return SetPattern( '0' ); }); $('#LEDColor').change( function(e){ var sel = $('#LEDSelect'); val = sel.val(); sel.val( val.replace( /#[a-zA-Z0-9]{6,6}(?!.*#[a-zA-Z0-9]{6,6})/, this.value) ); //sel.val( val.replace( /#\d{6,6}$/, this.color) ); ======= var val = parseInt( $('#LEDNum').val() ); if( val<0 || val>512 || isNaN(val) ) $('#LEDNum').val(4); >>>>>>> nled = parseInt( $('#LEDNum').val() ); if( val<0 || val>512 || isNaN(val) ) nled = 4; $('#LEDNum').val(nled); }); // Select a pattern to be used continously $('#LEDPbtn').click( function(e) { var ptrn = $('#LEDSelect').val(); return SetPattern( ptrn ); }); // Stop LEDs from changing $('#LEDSbtn').click( function(e) { return SetPattern( '255' ); }); // Turn all LEDs to black $('#LEDObtn').click( function(e) { document.getElementById('LEDColor').value = '#000000'; return SetPattern( '0' ); }); $('#LEDColor').change( function(e){ var sel = $('#LEDSelect'); val = sel.val(); sel.val( val.replace( /#[a-zA-Z0-9]{6,6}(?!.*#[a-zA-Z0-9]{6,6})/, this.value) ); //sel.val( val.replace( /#\d{6,6}$/, this.color) ); <<<<<<< var s = (i-1)*6; qDat[byte++] = strToByte(led_data, s+0); qDat[byte++] = strToByte(led_data, s+2); qDat[byte++] = strToByte(led_data, s+4); ======= qStr[byte++] = parseInt(led_data.substr((i-1)*6+0, 2), 16); qStr[byte++] = parseInt(led_data.substr((i-1)*6+2, 2), 16); qStr[byte++] = parseInt(led_data.substr((i-1)*6+4, 2), 16); >>>>>>> var s = (i-1)*6; qDat[byte++] = strToByte(led_data, s+0); qDat[byte++] = strToByte(led_data, s+2); qDat[byte++] = strToByte(led_data, s+4); <<<<<<< window.addEventListener("load", initLEDs, false); ======= window.addEventListener("load", KickLEDs, false); >>>>>>> window.addEventListener("load", initLEDs, false); <<<<<<< nled = Number( secs[1] ); led_data = secs[2]; ======= nled = Number( secs[1] ); led_data = secs[2]; var lastsamp = parseInt( led_data.substr(0,4),16 ); >>>>>>> nled = Number( secs[1] ); led_data = secs[2]; <<<<<<< } ======= } >>>>>>> }
<<<<<<< * Backbone post statuses collection */ wp.api.collections.PostStatuses = Backbone.Collection.extend({ url: WP_API_Settings.root + '/posts/statuses', model: wp.api.models.PostStatus }); /** ======= * Backbone media library collection */ wp.api.collections.MediaLibrary = Backbone.Collection.extend({ url: WP_API_Settings.root + '/media', model: wp.api.models.Media }); /** >>>>>>> * Backbone post statuses collection */ wp.api.collections.PostStatuses = Backbone.Collection.extend({ url: WP_API_Settings.root + '/posts/statuses', model: wp.api.models.PostStatus }); /** * Backbone media library collection */ wp.api.collections.MediaLibrary = Backbone.Collection.extend({ url: WP_API_Settings.root + '/media', model: wp.api.models.Media }); /**
<<<<<<< * Backbone model for a post status */ wp.api.models.PostStatus = Backbone.Model.extend( { idAttribute: 'slug', urlRoot: WP_API_Settings.root + '/posts/statuses', defaults: { slug: null, name: '', 'public': true, 'protected': false, 'private': false, queryable: true, show_in_list: true, meta: { links: {} } }, /** * This model is read only */ save: function() { return false; }, 'delete': function() { return false; } }); /** ======= * Backbone model for media items */ wp.api.models.Media = Backbone.Model.extend( { idAttribute: 'ID', urlRoot: WP_API_Settings.root + '/media', defaults: { ID: null, title: '', status: 'inherit', type: 'attachment', author: {}, content: '', parent: 0, link: '', date: new Date(), modified: new Date(), format: 'standard', slug: '', guid: '', excerpt: null, menu_order: 0, comment_status: 'open', ping_status: 'open', sticky: false, date_tz: 'Etc/UTC', modified_tz: 'Etc/UTC', meta: { links: {} }, terms: [], source: '', is_image: true, attachment_meta: {} } }); /** >>>>>>> * Backbone model for a post status */ wp.api.models.PostStatus = Backbone.Model.extend( { idAttribute: 'slug', urlRoot: WP_API_Settings.root + '/posts/statuses', defaults: { slug: null, name: '', 'public': true, 'protected': false, 'private': false, queryable: true, show_in_list: true, meta: { links: {} } }, /** * This model is read only */ save: function() { return false; }, 'delete': function() { return false; } }); /** * Backbone model for media items */ wp.api.models.Media = Backbone.Model.extend( { idAttribute: 'ID', urlRoot: WP_API_Settings.root + '/media', defaults: { ID: null, title: '', status: 'inherit', type: 'attachment', author: {}, content: '', parent: 0, link: '', date: new Date(), modified: new Date(), format: 'standard', slug: '', guid: '', excerpt: null, menu_order: 0, comment_status: 'open', ping_status: 'open', sticky: false, date_tz: 'Etc/UTC', modified_tz: 'Etc/UTC', meta: { links: {} }, terms: [], source: '', is_image: true, attachment_meta: {} } }); /**
<<<<<<< }, { id: 'Kune' ,logo: 'kune.png' ,name: 'Kune' ,description: 'Kune is a web tool, based on Apache Wave, for creating environments of constant inter-communication, collective intelligence, knowledge and shared work.' ,url: 'https://kune.cc' ,type: 'messaging' ======= }, { id: 'googlevoice' ,logo: 'googlevoice.png' ,name: 'Google Voice' ,description: 'A free phone number for life. Stay in touch from any screen. Use your free number to text, call, and check voicemail all from one app. Plus, Google Voice works on all of your devices so you can connect and communicate how you want.' ,url: 'https://voice.google.com' ,type: 'messaging' ,js_unread: 'function parseIntOrZero(e){return isNaN(parseInt(e))?0:parseInt(e)}function checkUnread(){var e=document.querySelector(".msgCount"),n=0;e?n=parseIntOrZero(e.innerHTML.replace(/[\(\) ]/gi,"")):["Messages","Calls","Voicemail"].forEach(function(e){var r=document.querySelector(\'gv-nav-button[tooltip="\'+e+\'"] div[aria-label="Unread count"]\');r&&(n+=parseIntOrZero(r.innerHTML))}),updateBadge(n)}function updateBadge(e){var n=e>0?"("+e+") ":"";document.title=n+originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);' >>>>>>> }, { id: 'Kune' ,logo: 'kune.png' ,name: 'Kune' ,description: 'Kune is a web tool, based on Apache Wave, for creating environments of constant inter-communication, collective intelligence, knowledge and shared work.' ,url: 'https://kune.cc' ,type: 'messaging' }, { id: 'googlevoice' ,logo: 'googlevoice.png' ,name: 'Google Voice' ,description: 'A free phone number for life. Stay in touch from any screen. Use your free number to text, call, and check voicemail all from one app. Plus, Google Voice works on all of your devices so you can connect and communicate how you want.' ,url: 'https://voice.google.com' ,type: 'messaging' ,js_unread: 'function parseIntOrZero(e){return isNaN(parseInt(e))?0:parseInt(e)}function checkUnread(){var e=document.querySelector(".msgCount"),n=0;e?n=parseIntOrZero(e.innerHTML.replace(/[\(\) ]/gi,"")):["Messages","Calls","Voicemail"].forEach(function(e){var r=document.querySelector(\'gv-nav-button[tooltip="\'+e+\'"] div[aria-label="Unread count"]\');r&&(n+=parseIntOrZero(r.innerHTML))}),updateBadge(n)}function updateBadge(e){var n=e>0?"("+e+") ":"";document.title=n+originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);'
<<<<<<< }, { id: 'devrant' ,logo: 'devrant.png' ,name: 'devRant' ,description: 'Share and bond over successes and frustrations with code, tech and life as a programmer' ,url: 'https://devrant.com/' ,type: 'messaging' ,js_unread: 'function checkUnread(){var a=document.querySelectorAll(".menu-notif.notif-badge")[0];updateBadge(t=a===undefined?0:(a.textContent.length?parseInt(a.textContent.replace(/[^0-9]/g,"")):0))}function updateBadge(a){a>=1?rambox.setUnreadCount(a):rambox.clearUnreadCount()}setInterval(checkUnread,3000);' ======= }, { id: 'reddit' ,logo: 'reddit.png' ,name: 'Reddit' ,description: 'Reddit\'s in-build chat service.' ,url: 'https://www.reddit.com/chat' ,type: 'messaging' >>>>>>> }, { id: 'devrant' ,logo: 'devrant.png' ,name: 'devRant' ,description: 'Share and bond over successes and frustrations with code, tech and life as a programmer' ,url: 'https://devrant.com/' ,type: 'messaging' ,js_unread: 'function checkUnread(){var a=document.querySelectorAll(".menu-notif.notif-badge")[0];updateBadge(t=a===undefined?0:(a.textContent.length?parseInt(a.textContent.replace(/[^0-9]/g,"")):0))}function updateBadge(a){a>=1?rambox.setUnreadCount(a):rambox.clearUnreadCount()}setInterval(checkUnread,3000);' }, { id: 'reddit' ,logo: 'reddit.png' ,name: 'Reddit' ,description: 'Reddit\'s in-build chat service.' ,url: 'https://www.reddit.com/chat' ,type: 'messaging'
<<<<<<< if ( messageCount > 0 && !mainWindow.isFocused() && !config.get('dont_disturb') ) mainWindow.flashFrame(true); ======= if ( messageCount > 0 && !mainWindow.isFocused() && config.get('flash_frame') ) { mainWindow.flashFrame(true); } >>>>>>> if ( messageCount > 0 && !mainWindow.isFocused() && !config.get('dont_disturb') && config.get('flash_frame') ) mainWindow.flashFrame(true);
<<<<<<< viewBox={ viewBox ? viewBox : `0 0 ${width} ${height}` } className="rsm-svg" ======= viewBox={ `0 0 ${width} ${height}` } className={ `rsm-svg ${className || ''}` } >>>>>>> viewBox={ viewBox ? viewBox : `0 0 ${width} ${height}` } className={ `rsm-svg ${className || ''}` }
<<<<<<< const backgroundColors = [ 'rgba(255,99,132,0.7)', 'rgba(75,192,192,0.7)', 'rgba(255,206,86,0.7)', 'rgba(54,162,235,0.7)', 'rgba(170,13,197,0.5)' //last color is used for the Radar chart ]; const pointColors = [ // these are used for the points on the Radar chart 'rgba(255,99,132,1)', 'rgba(75,192,192,1)', 'rgba(255,206,86,1)', 'rgba(54,162,235,1)' ] ======= const chartTitle = [' Web Technologies', ' Mobile Technologies', ' Programming Languages', ' Backend Technologies']; >>>>>>> const backgroundColors = [ 'rgba(255,99,132,0.7)', 'rgba(75,192,192,0.7)', 'rgba(255,206,86,0.7)', 'rgba(54,162,235,0.7)', 'rgba(170,13,197,0.5)' //last color is used for the Radar chart ]; const pointColors = [ // these are used for the points on the Radar chart 'rgba(255,99,132,1)', 'rgba(75,192,192,1)', 'rgba(255,206,86,1)', 'rgba(54,162,235,1)' ] const chartTitle = [' Web Technologies', ' Mobile Technologies', ' Programming Languages', ' Backend Technologies']; <<<<<<< headerClass: "navbar navbar-expand-lg navbar-light fixed-top", chartChoice: "Polar", zoomLevel: 55 ======= >>>>>>> chartChoice: "Polar", zoomLevel: 55 <<<<<<< changeChart = () => { const choice = this.state.chartChoice==="Polar"?"Radar":"Polar"; this.setState( { chartChoice: choice }, ()=>{this.getData(this.state.currentTopic)}) } zoom = (event) => { console.log(this.state.cData.datasets[0].data) //cData.datasets[0].data.reduce((acc, crt)=>crt>acc?crt:acc) this.setState({ zoomLevel: 100-Number(event.target.value) }); } handleScroll = () => { //"navbar navbar-expand-md navbar-light fixed-top" if (window.scrollY <= 10 ) { this.setState({headerClass: "navbar navbar-expand-lg navbar-light fixed-top"}) } else if (this.state.headerClass === "navbar navbar-expand-lg navbar-light fixed-top"){ this.setState({headerClass: "navbar navbar-expand-lg navbar-light fixed-top scroll smLogo"}) } } ======= >>>>>>> changeChart = () => { const choice = this.state.chartChoice==="Polar"?"Radar":"Polar"; this.setState( { chartChoice: choice }, ()=>{this.getData(this.state.currentTopic)}) } zoom = (event) => { console.log(this.state.cData.datasets[0].data) //cData.datasets[0].data.reduce((acc, crt)=>crt>acc?crt:acc) this.setState({ zoomLevel: 100-Number(event.target.value) }); } <<<<<<< const { cData, rawData, currentTopic, contributors, chartChoice, zoomLevel, minimZoom } = this.state; ======= const { cData, rawData, currentTopic, contributors } = this.state; >>>>>>> const { cData, rawData, currentTopic, contributors, chartChoice, zoomLevel, minimZoom } = this.state;
<<<<<<< <nav id="header" className={headerClass}> <Link to="top" smooth duration={800} offset={-131}> <img src={logo} alt="logo" height="50" className="logo-active" /> </Link> ======= <nav id="header" className="navbar navbar-expand-md navbar-light fixed-top"> >>>>>>> <nav id="header" className={headerClass}>
<<<<<<< const header = document.querySelector('header'); // const nav = document.querySelector('#header'); return header.classList.toggle('is-open'); // return ; ======= const header = document.querySelector('#header'); return header.classList.toggle('show'); >>>>>>> const header = document.querySelector('header'); return header.classList.toggle('is-open'); // const header = document.querySelector('#header'); // return header.classList.toggle('show'); <<<<<<< constructor() { super(); const currentTopic = chartData[currentCatIndexGlobal][0].name; const rawData = dataExtractor(currentCatIndexGlobal); this.state = { cData: {}, currentTopic: currentTopic, rawData: rawData, contributors: [], chartChoice: "Polar", zoomLevel: 55 } this.keyCount = 0; this.getKey = this.getKey.bind(this); this.setLoveHearts(currentTopic, rawData); } getKey() { return this.keyCount++; } fetchContributors = async () => { await fetch('https://api.github.com/repos/zeroDevs/coding_challenge-13/contributors') .then(res => res.json()) .then(json => this.setState({ contributors: json })); } componentDidMount() { this.getData(this.state.currentTopic); this.fetchContributors(); window.addEventListener('scroll', this.handleScroll); navToggler[0].addEventListener('click', headerToggle); } getData(currentSelection) { const { langArray, gJobArray, usJobArray, supJobArray, remJobArray } = this.state.rawData; const cIndex = langArray.indexOf(currentSelection); this.setState({ currentTopic: currentSelection, cData: { datasets: [ { data: [gJobArray[cIndex], usJobArray[cIndex], supJobArray[cIndex], remJobArray[cIndex]], label: currentSelection, backgroundColor: this.state.chartChoice === "Polar" ? backgroundColors : backgroundColors[4], borderColor: 'white', hoverBorderColor: 'white', hoverBackgroundColor: pointColors, pointBackgroundColor: pointColors, pointBorderColor: "#fff", pointBorderWidth: 2, pointHoverBackgroundColor: pointColors, pointHoverBorderColor: pointColors, pointRadius: 5, pointHoverRadius: 7 } ], labels: ['Global Job Demand', 'US Job Demand', 'Startup Job Demand', 'Remote Job Demand'] } }, () => { this.setState({ minimZoom: 100 - Math.ceil(Math.max.apply(null, this.state.cData.datasets[0].data)) }) }); this.setLoveHearts(currentSelection, this.state.rawData); } onTopicClick = (topic) => { this.getData(topic); } onNavClick = (index) => { currentCatIndexGlobal = index; this.setState({ rawData: dataExtractor(index) }, () => { this.getData(this.state.rawData.langArray[0]); }) } returnLove = (redHearts) => { let maxHearts = 5; const hearts = []; while (redHearts--) { hearts.push(<img src={Heart} alt="active love" height="25" key={this.getKey()} />); maxHearts--; } while (maxHearts--) hearts.push(<img src={Heart} alt="inactive love" height="25" key={this.getKey()} style={{ filter: "grayscale(1)" }} />) return hearts; } setLoveHearts = (currentTopic, rawData) => { loveHearts = this.returnLove(rawData.devLoveArray[rawData.langArray.indexOf(currentTopic)] / 20); } changeChart = () => { const choice = this.state.chartChoice === "Polar" ? "Radar" : "Polar"; this.setState( { chartChoice: choice }, () => { this.getData(this.state.currentTopic) }) } zoom = (event) => { this.setState({ zoomLevel: 100 - Number(event.target.value) }); } render() { const { cData, rawData, currentTopic, contributors, chartChoice, zoomLevel, minimZoom } = this.state; return ( <div id="top" ref={(ref) => this.scrollIcon = ref}> <Header /> <Navigation onNavClick={this.onNavClick} currentCategoryIndex={currentCatIndexGlobal} /> <section className="trends"> <h2 className="title">Top 5 {chartTitle[currentCatIndexGlobal]}</h2> <div className="chart-container"> <Rank langArray={rawData.langArray} onTopicClick={this.onTopicClick} checkbox={currentTopic} /> <Tooltip tooltipText='This is a score out of 5 based on developer opinion, community size, downloads, Google searches, and satisfaction surveys, etc..'> <h5 className="pr-1">Developer Love:</h5> <h5 className="pl-1 anim-waving ">{loveHearts}</h5> </Tooltip> <div className="chartHolder"> <div className="switchbox"> <p>Chart type</p> <Switch onClick={this.changeChart} leftText="Polar" rightText="Radar" /> </div> <div className="chartbox"> <Chart data={cData} type={chartChoice} zoomLevel={zoomLevel} /> </div> <div className="zoombox"> <div className="zoomSlider"> <div>-</div><input className="slider" type="range" min="1" max={minimZoom} step="1" onChange={this.zoom} /><div>+</div> </div> <p>&#9906;</p> </div> </div> </div> </section> <Newsletter /> <Data loveFunction={this.returnLove} /> <Suspense fallback={<div>Loading...</div>}> <Footer contrib={contributors} /> </Suspense> </div> ); } ======= constructor() { super(); const currentTopic = chartData[currentCatIndexGlobal][0].name; const rawData = dataExtractor(currentCatIndexGlobal); this.state = { cData: {}, currentTopic: currentTopic, rawData: rawData, contributors: [], chartChoice: "Polar", zoomLevel: 55 } this.keyCount = 0; this.getKey = this.getKey.bind(this); this.setLoveHearts(currentTopic, rawData); } getKey() { return this.keyCount++; } fetchContributors = async () => { await fetch('https://api.github.com/repos/zeroDevs/coding_challenge-13/contributors') .then(res => res.json()) .then(json => this.setState({ contributors: json })); } componentDidMount() { this.getData(this.state.currentTopic); this.fetchContributors(); window.addEventListener('scroll', this.handleScroll); navToggler[0].addEventListener('click', headerToggle); } getData(currentSelection) { const { langArray, gJobArray, usJobArray, supJobArray, remJobArray } = this.state.rawData; const cIndex = langArray.indexOf(currentSelection); this.setState({ currentTopic: currentSelection, cData: { datasets: [ { data: [gJobArray[cIndex], usJobArray[cIndex], supJobArray[cIndex], remJobArray[cIndex]], label: currentSelection, backgroundColor: this.state.chartChoice === "Polar" ? backgroundColors : backgroundColors[4], borderColor: 'white', hoverBorderColor: 'white', hoverBackgroundColor: pointColors, pointBackgroundColor: pointColors, pointBorderColor: "#fff", pointBorderWidth: 2, pointHoverBackgroundColor: pointColors, pointHoverBorderColor: pointColors, pointRadius: 5, pointHoverRadius: 7 } ], labels: ['Global Job Demand', 'US Job Demand', 'Startup Job Demand', 'Remote Job Demand'] } }, () => { this.setState({ minimZoom: 100 - Math.ceil(Math.max.apply(null, this.state.cData.datasets[0].data)) }) }); this.setLoveHearts(currentSelection, this.state.rawData); } onTopicClick = (topic) => { this.getData(topic); } onNavClick = (index) => { currentCatIndexGlobal = index; this.setState({ rawData: dataExtractor(index) }, () => { this.getData(this.state.rawData.langArray[0]); }) } returnLove = (redHearts) => { let maxHearts = 5; const hearts = []; while (redHearts--) { hearts.push(<img src={Heart} alt="active love" height="25" key={this.getKey()} />); maxHearts--; } while (maxHearts--) hearts.push(<img src={Heart} alt="inactive love" height="25" key={this.getKey()} style={{ filter: "grayscale(1)" }} />) return hearts; } setLoveHearts = (currentTopic, rawData) => { loveHearts = this.returnLove(rawData.devLoveArray[rawData.langArray.indexOf(currentTopic)] / 20); } changeChart = () => { const choice = this.state.chartChoice === "Polar" ? "Radar" : "Polar"; this.setState( { chartChoice: choice }, () => { this.getData(this.state.currentTopic) }) } zoom = (event) => { this.setState({ zoomLevel: 100 - Number(event.target.value) }); } render() { const { cData, rawData, currentTopic, contributors, chartChoice, zoomLevel, minimZoom } = this.state; return ( <div id="top" ref={(ref) => this.scrollIcon = ref}> <Header /> <Navigation onNavClick={this.onNavClick} currentCategoryIndex={currentCatIndexGlobal} /> <section className="trends"> <h2 className="title">Top 5 {chartTitle[currentCatIndexGlobal]}</h2> <div className="chart-container"> <Rank langArray={rawData.langArray} onTopicClick={this.onTopicClick} checkbox={currentTopic} /> <Tooltip tooltipText='This is a score out of 5 based on developer opinion, community size, downloads, Google searches, and satisfaction surveys, etc..'> <h5 className="pr-1">Developer Love:</h5> <h5 className="pl-1 anim-waving ">{loveHearts}</h5> </Tooltip> <div className="chartHolder"> <div className="switchbox"> <p>Chart type</p> <Switch onClick={this.changeChart} leftText="Polar" rightText="Radar" /> </div> <div className="chartbox"> <Chart data={cData} type={chartChoice} zoomLevel={zoomLevel} /> </div> <div className="zoombox"> <div className="zoomSlider"> <div>-</div><input className="slider" type="range" min="1" max={minimZoom} step="1" onChange={this.zoom} /><div>+</div> </div> <p>&#9906;</p> </div> </div> </div> </section> <Newsletter /> <Data loveFunction={this.returnLove} /> <Suspense fallback={<div>Loading...</div>}> <Footer contrib={contributors} /> </Suspense> </div> ); } >>>>>>> constructor() { super(); const currentTopic = chartData[currentCatIndexGlobal][0].name; const rawData = dataExtractor(currentCatIndexGlobal); this.state = { cData: {}, currentTopic: currentTopic, rawData: rawData, contributors: [], chartChoice: "Polar", zoomLevel: 55 } this.keyCount = 0; this.getKey = this.getKey.bind(this); this.setLoveHearts(currentTopic, rawData); } getKey() { return this.keyCount++; } fetchContributors = async () => { await fetch('https://api.github.com/repos/zeroDevs/coding_challenge-13/contributors') .then(res => res.json()) .then(json => this.setState({ contributors: json })); } componentDidMount() { this.getData(this.state.currentTopic); this.fetchContributors(); window.addEventListener('scroll', this.handleScroll); navToggler[0].addEventListener('click', headerToggle); } getData(currentSelection) { const { langArray, gJobArray, usJobArray, supJobArray, remJobArray } = this.state.rawData; const cIndex = langArray.indexOf(currentSelection); this.setState({ currentTopic: currentSelection, cData: { datasets: [ { data: [gJobArray[cIndex], usJobArray[cIndex], supJobArray[cIndex], remJobArray[cIndex]], label: currentSelection, backgroundColor: this.state.chartChoice === "Polar" ? backgroundColors : backgroundColors[4], borderColor: 'white', hoverBorderColor: 'white', hoverBackgroundColor: pointColors, pointBackgroundColor: pointColors, pointBorderColor: "#fff", pointBorderWidth: 2, pointHoverBackgroundColor: pointColors, pointHoverBorderColor: pointColors, pointRadius: 5, pointHoverRadius: 7 } ], labels: ['Global Job Demand', 'US Job Demand', 'Startup Job Demand', 'Remote Job Demand'] } }, () => { this.setState({ minimZoom: 100 - Math.ceil(Math.max.apply(null, this.state.cData.datasets[0].data)) }) }); this.setLoveHearts(currentSelection, this.state.rawData); } onTopicClick = (topic) => { this.getData(topic); } onNavClick = (index) => { currentCatIndexGlobal = index; this.setState({ rawData: dataExtractor(index) }, () => { this.getData(this.state.rawData.langArray[0]); }) } returnLove = (redHearts) => { let maxHearts = 5; const hearts = []; while (redHearts--) { hearts.push(<img src={Heart} alt="active love" height="25" key={this.getKey()} />); maxHearts--; } while (maxHearts--) hearts.push(<img src={Heart} alt="inactive love" height="25" key={this.getKey()} style={{ filter: "grayscale(1)" }} />) return hearts; } setLoveHearts = (currentTopic, rawData) => { loveHearts = this.returnLove(rawData.devLoveArray[rawData.langArray.indexOf(currentTopic)] / 20); } changeChart = () => { const choice = this.state.chartChoice === "Polar" ? "Radar" : "Polar"; this.setState( { chartChoice: choice }, () => { this.getData(this.state.currentTopic) }) } zoom = (event) => { this.setState({ zoomLevel: 100 - Number(event.target.value) }); } render() { const { cData, rawData, currentTopic, contributors, chartChoice, zoomLevel, minimZoom } = this.state; return ( <div id="top" ref={(ref) => this.scrollIcon = ref}> <Header /> <Navigation onNavClick={this.onNavClick} currentCategoryIndex={currentCatIndexGlobal} /> <section className="trends"> <h2 className="title">Top 5 {chartTitle[currentCatIndexGlobal]}</h2> <div className="chart-container"> <Rank langArray={rawData.langArray} onTopicClick={this.onTopicClick} checkbox={currentTopic} /> <Tooltip tooltipText='This is a score out of 5 based on developer opinion, community size, downloads, Google searches, and satisfaction surveys, etc..'> <h5 className="pr-1">Developer Love:</h5> <h5 className="pl-1 anim-waving ">{loveHearts}</h5> </Tooltip> <div className="chartHolder"> <div className="switchbox"> <p>Chart type</p> <Switch onClick={this.changeChart} leftText="Polar" rightText="Radar" /> </div> <div className="chartbox"> <Chart data={cData} type={chartChoice} zoomLevel={zoomLevel} /> </div> <div className="zoombox"> <div className="zoomSlider"> <div>-</div><input className="slider" type="range" min="1" max={minimZoom} step="1" onChange={this.zoom} /><div>+</div> </div> <p>&#9906;</p> </div> </div> </div> </section> <Newsletter /> <Data loveFunction={this.returnLove} /> <Suspense fallback={<div>Loading...</div>}> <Footer contrib={contributors} /> </Suspense> </div> ); }