mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 06:43:24 +00:00
Implement coding standards
This commit is contained in:
@@ -6,7 +6,6 @@ import { autoBind } from 'react-extras';
|
|||||||
* Announcement component
|
* Announcement component
|
||||||
*/
|
*/
|
||||||
export default class Announcement extends React.Component {
|
export default class Announcement extends React.Component {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
text: PropTypes.string
|
text: PropTypes.string
|
||||||
};
|
};
|
||||||
@@ -27,5 +26,4 @@ export default class Announcement extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
return <div className="announcement" >{this.props.text}</div>;
|
return <div className="announcement" >{this.props.text}</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,12 +56,11 @@ function selectAll(e) {
|
|||||||
* Coriolis App Header section / menus
|
* Coriolis App Header section / menus
|
||||||
*/
|
*/
|
||||||
export default class Header extends TranslatedComponent {
|
export default class Header extends TranslatedComponent {
|
||||||
|
/**
|
||||||
/**
|
* Constructor
|
||||||
* Constructor
|
* @param {Object} props React Component properties
|
||||||
* @param {Object} props React Component properties
|
* @param {Object} context React Component context
|
||||||
* @param {Object} context React Component context
|
*/
|
||||||
*/
|
|
||||||
constructor(props, context) {
|
constructor(props, context) {
|
||||||
super(props);
|
super(props);
|
||||||
this.shipOrder = Object.keys(Ships).sort();
|
this.shipOrder = Object.keys(Ships).sort();
|
||||||
@@ -509,7 +508,7 @@ export default class Header extends TranslatedComponent {
|
|||||||
<td style={{ width: 20 }}><span style={{ fontSize: 30 }}>A</span></td>
|
<td style={{ width: 20 }}><span style={{ fontSize: 30 }}>A</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colSpan='3' style={{ textAlign: 'center', cursor: 'pointer' }} className='primary-disabled cap' onClick={this._resetTextSize.bind(this)}>{translate('reset')}</td>
|
<td colSpan='3' style={{ textAlign: 'center', cursor: 'pointer' }} className='primary-disabled cap' onClick={this._resetTextSize.bind(this)}>{translate('reset')}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -608,7 +607,7 @@ export default class Header extends TranslatedComponent {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='l menu'>
|
<div className='l menu'>
|
||||||
<div className={cn('menu-header', { selected: openedMenu == 'announce', disabled: this.props.announcements.length === 0})} onClick={this.props.announcements.length !== 0 && this._openAnnounce}>
|
<div className={cn('menu-header', { selected: openedMenu == 'announce', disabled: this.props.announcements.length === 0 })} onClick={this.props.announcements.length !== 0 && this._openAnnounce}>
|
||||||
<span className='menu-item-label'>{translate('announcements')}</span>
|
<span className='menu-item-label'>{translate('announcements')}</span>
|
||||||
</div>
|
</div>
|
||||||
{openedMenu == 'announce' ? this._getAnnouncementsMenu() : null}
|
{openedMenu == 'announce' ? this._getAnnouncementsMenu() : null}
|
||||||
@@ -639,5 +638,4 @@ export default class Header extends TranslatedComponent {
|
|||||||
</header>
|
</header>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ const MARGIN = { top: 15, right: 20, bottom: 35, left: 60 };
|
|||||||
* Line Chart
|
* Line Chart
|
||||||
*/
|
*/
|
||||||
export default class LineChart extends TranslatedComponent {
|
export default class LineChart extends TranslatedComponent {
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
code: '',
|
code: '',
|
||||||
xMin: 0,
|
xMin: 0,
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { shallowEqual } from '../utils/UtilityFunctions';
|
|||||||
* Link wrapper component
|
* Link wrapper component
|
||||||
*/
|
*/
|
||||||
export default class Link extends React.Component {
|
export default class Link extends React.Component {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
children: PropTypes.any,
|
children: PropTypes.any,
|
||||||
href: PropTypes.string.isRequired,
|
href: PropTypes.string.isRequired,
|
||||||
@@ -56,5 +55,4 @@ export default class Link extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
return <a {...this.props} onClick={this.handler}>{this.props.children}</a>;
|
return <a {...this.props} onClick={this.handler}>{this.props.children}</a>;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import Persist from '../stores/Persist';
|
|||||||
* Permalink modal
|
* Permalink modal
|
||||||
*/
|
*/
|
||||||
export default class ModalBatchOrbis extends TranslatedComponent {
|
export default class ModalBatchOrbis extends TranslatedComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
ships: PropTypes.any.isRequired
|
ships: PropTypes.any.isRequired
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ function buildComparator(a, b) {
|
|||||||
* Compare builds modal
|
* Compare builds modal
|
||||||
*/
|
*/
|
||||||
export default class ModalCompare extends TranslatedComponent {
|
export default class ModalCompare extends TranslatedComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
onSelect: PropTypes.func.isRequired,
|
onSelect: PropTypes.func.isRequired,
|
||||||
builds: PropTypes.array
|
builds: PropTypes.array
|
||||||
@@ -105,8 +104,8 @@ export default class ModalCompare extends TranslatedComponent {
|
|||||||
|
|
||||||
let selectedBuilds = usedBuilds.map((build, i) =>
|
let selectedBuilds = usedBuilds.map((build, i) =>
|
||||||
<tr key={i} onClick={this._removeBuild.bind(this, i)}>
|
<tr key={i} onClick={this._removeBuild.bind(this, i)}>
|
||||||
<td className='tl'>{build.name}</td><
|
<td className='tl'>{build.name}</td>
|
||||||
td className='tl'>{build.buildName}</td>
|
<td className='tl'>{build.buildName}</td>
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import TranslatedComponent from './TranslatedComponent';
|
|||||||
* Export Modal
|
* Export Modal
|
||||||
*/
|
*/
|
||||||
export default class ModalExport extends TranslatedComponent {
|
export default class ModalExport extends TranslatedComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
title: PropTypes.string,
|
title: PropTypes.string,
|
||||||
generator: PropTypes.func,
|
generator: PropTypes.func,
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import TranslatedComponent from './TranslatedComponent';
|
|||||||
* Help Modal
|
* Help Modal
|
||||||
*/
|
*/
|
||||||
export default class ModalHelp extends TranslatedComponent {
|
export default class ModalHelp extends TranslatedComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
title: PropTypes.string
|
title: PropTypes.string
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -85,8 +85,6 @@ function detailedJsonToBuild(detailedBuild) {
|
|||||||
* Import Modal
|
* Import Modal
|
||||||
*/
|
*/
|
||||||
export default class ModalImport extends TranslatedComponent {
|
export default class ModalImport extends TranslatedComponent {
|
||||||
|
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
builds: PropTypes.object, // Optional: Import object
|
builds: PropTypes.object, // Optional: Import object
|
||||||
};
|
};
|
||||||
@@ -130,7 +128,7 @@ export default class ModalImport extends TranslatedComponent {
|
|||||||
if (data && data.Ship && data.Modules) {
|
if (data && data.Ship && data.Modules) {
|
||||||
const deflated = zlib.deflate(JSON.stringify(data), { to: 'string' });
|
const deflated = zlib.deflate(JSON.stringify(data), { to: 'string' });
|
||||||
let compressed = btoa(deflated);
|
let compressed = btoa(deflated);
|
||||||
this.setState({loadoutEvent: compressed});
|
this.setState({ loadoutEvent: compressed });
|
||||||
} else {
|
} else {
|
||||||
throw 'Loadout event must contain Ship and Modules';
|
throw 'Loadout event must contain Ship and Modules';
|
||||||
}
|
}
|
||||||
@@ -542,7 +540,7 @@ export default class ModalImport extends TranslatedComponent {
|
|||||||
{comparisonRows}
|
{comparisonRows}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.state.canEdit) {
|
if(this.state.canEdit) {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import Persist from '../stores/Persist';
|
|||||||
* Permalink modal
|
* Permalink modal
|
||||||
*/
|
*/
|
||||||
export default class ModalOrbis extends TranslatedComponent {
|
export default class ModalOrbis extends TranslatedComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
ship: PropTypes.any.isRequired
|
ship: PropTypes.any.isRequired
|
||||||
};
|
};
|
||||||
@@ -58,14 +57,14 @@ export default class ModalOrbis extends TranslatedComponent {
|
|||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
mode: 'cors'
|
mode: 'cors'
|
||||||
})
|
})
|
||||||
.then(data => data.json())
|
.then(data => data.json())
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.setState({ authenticatedStatus: res.status || res.error });
|
this.setState({ authenticatedStatus: res.status || res.error });
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
this.setState({ authenticatedStatus: err.message });
|
this.setState({ authenticatedStatus: err.message });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -98,7 +97,7 @@ export default class ModalOrbis extends TranslatedComponent {
|
|||||||
let ship = this.state.ship;
|
let ship = this.state.ship;
|
||||||
let cat = e.target.value;
|
let cat = e.target.value;
|
||||||
ship.category = cat;
|
ship.category = cat;
|
||||||
this.setState({ship});
|
this.setState({ ship });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import ShortenUrl from '../utils/ShortenUrl';
|
|||||||
* Permalink modal
|
* Permalink modal
|
||||||
*/
|
*/
|
||||||
export default class ModalPermalink extends TranslatedComponent {
|
export default class ModalPermalink extends TranslatedComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
url: PropTypes.string.isRequired
|
url: PropTypes.string.isRequired
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import Persist from '../stores/Persist';
|
|||||||
* Permalink modal
|
* Permalink modal
|
||||||
*/
|
*/
|
||||||
export default class ModalShoppingList extends TranslatedComponent {
|
export default class ModalShoppingList extends TranslatedComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
ship: PropTypes.object.isRequired
|
ship: PropTypes.object.isRequired
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ const LABEL_COLOUR = '#000000';
|
|||||||
* A pie chart
|
* A pie chart
|
||||||
*/
|
*/
|
||||||
export default class PieChart extends Component {
|
export default class PieChart extends Component {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
data : PropTypes.array.isRequired
|
data : PropTypes.array.isRequired
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ export default class PowerManagement extends TranslatedComponent {
|
|||||||
m.setPowerPriority(newPrio);
|
m.setPowerPriority(newPrio);
|
||||||
onChange();
|
onChange();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -114,11 +114,11 @@ export default class ShipPicker extends TranslatedComponent {
|
|||||||
<span className='menu-item-label'>{shipString}</span>
|
<span className='menu-item-label'>{shipString}</span>
|
||||||
</div>
|
</div>
|
||||||
{ menuOpen ?
|
{ menuOpen ?
|
||||||
<div className='menu-list' onClick={ (e) => e.stopPropagation() }>
|
<div className='menu-list' onClick={ (e) => e.stopPropagation() }>
|
||||||
<div className='quad'>
|
<div className='quad'>
|
||||||
{this._renderPickerMenu()}
|
{this._renderPickerMenu()}
|
||||||
</div>
|
</div>
|
||||||
</div> : null }
|
</div> : null }
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ export default class ShipSummaryTable extends TranslatedComponent {
|
|||||||
const canJump = true;
|
const canJump = true;
|
||||||
|
|
||||||
return <div id='summary'>
|
return <div id='summary'>
|
||||||
<div style={{display: "table", width: "100%"}}>
|
<div style={{ display: 'table', width: '100%' }}>
|
||||||
<div style={{display: "table-row"}}>
|
<div style={{ display: 'table-row' }}>
|
||||||
<table className={'summaryTable'}>
|
<table className={'summaryTable'}>
|
||||||
<thead>
|
<thead>
|
||||||
<tr className='main'>
|
<tr className='main'>
|
||||||
@@ -119,49 +119,49 @@ export default class ShipSummaryTable extends TranslatedComponent {
|
|||||||
<tr>
|
<tr>
|
||||||
<td onMouseEnter={termtip.bind(null, speedTooltip, { cap: 0 })}
|
<td onMouseEnter={termtip.bind(null, speedTooltip, { cap: 0 })}
|
||||||
onMouseLeave={hide}
|
onMouseLeave={hide}
|
||||||
>{canThrust
|
>{canThrust ?
|
||||||
? <span>{int(speed)}{u['m/s']}</span>
|
<span>{int(speed)}{u['m/s']}</span> :
|
||||||
: <span className='warning'>0<Warning/></span>
|
<span className='warning'>0<Warning/></span>
|
||||||
}</td>
|
}</td>
|
||||||
<td onMouseEnter={termtip.bind(null, boostTooltip, { cap: 0 })}
|
<td onMouseEnter={termtip.bind(null, boostTooltip, { cap: 0 })}
|
||||||
onMouseLeave={hide}
|
onMouseLeave={hide}
|
||||||
>{canBoost
|
>{canBoost ?
|
||||||
? <span>{int(shipBoost)}{u['m/s']}</span>
|
<span>{int(shipBoost)}{u['m/s']}</span> :
|
||||||
: <span className='warning'>0<Warning/></span>
|
<span className='warning'>0<Warning/></span>
|
||||||
}</td>
|
}</td>
|
||||||
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_MAX_SINGLE_JUMP', { cap: 0 })}
|
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_MAX_SINGLE_JUMP', { cap: 0 })}
|
||||||
onMouseLeave={hide}
|
onMouseLeave={hide}
|
||||||
>{canJump
|
>{canJump ?
|
||||||
// TODO:
|
// TODO:
|
||||||
? <span>{NaN}{u.LY}</span>
|
<span>{NaN}{u.LY}</span> :
|
||||||
: <span className='warning'>0<Warning/></span>
|
<span className='warning'>0<Warning/></span>
|
||||||
}</td>
|
}</td>
|
||||||
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_UNLADEN_SINGLE_JUMP', { cap: 0 })}
|
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_UNLADEN_SINGLE_JUMP', { cap: 0 })}
|
||||||
onMouseLeave={hide}
|
onMouseLeave={hide}
|
||||||
>{canJump
|
>{canJump ?
|
||||||
// TODO:
|
// TODO:
|
||||||
? <span>{NaN}{u.LY}</span>
|
<span>{NaN}{u.LY}</span> :
|
||||||
: <span className='warning'>0<Warning/></span>
|
<span className='warning'>0<Warning/></span>
|
||||||
}</td>
|
}</td>
|
||||||
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_LADEN_SINGLE_JUMP', { cap: 0 })}
|
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_LADEN_SINGLE_JUMP', { cap: 0 })}
|
||||||
onMouseLeave={hide}
|
onMouseLeave={hide}
|
||||||
>{canJump
|
>{canJump ?
|
||||||
? <span>{f2(jumpRangeMetrics.jumpRange)}{u.LY}</span>
|
<span>{f2(jumpRangeMetrics.jumpRange)}{u.LY}</span> :
|
||||||
: <span className='warning'>0<Warning/></span>
|
<span className='warning'>0<Warning/></span>
|
||||||
}</td>
|
}</td>
|
||||||
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_UNLADEN_TOTAL_JUMP', { cap: 0 })}
|
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_UNLADEN_TOTAL_JUMP', { cap: 0 })}
|
||||||
onMouseLeave={hide}
|
onMouseLeave={hide}
|
||||||
>{canJump
|
>{canJump ?
|
||||||
// TODO:
|
// TODO:
|
||||||
? <span>{NaN}{u.LY}</span>
|
<span>{NaN}{u.LY}</span> :
|
||||||
: <span className='warning'>0 <Warning/></span>
|
<span className='warning'>0 <Warning/></span>
|
||||||
}</td>
|
}</td>
|
||||||
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_LADEN_TOTAL_JUMP', { cap: 0 })}
|
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_LADEN_TOTAL_JUMP', { cap: 0 })}
|
||||||
onMouseLeave={hide}
|
onMouseLeave={hide}
|
||||||
>{canJump
|
>{canJump ?
|
||||||
? <span>{f2(jumpRangeMetrics.totalRange)}{u.LY}</span>
|
<span>{f2(jumpRangeMetrics.totalRange)}{u.LY}</span> :
|
||||||
: <span className='warning'>0<Warning/></span>
|
<span className='warning'>0<Warning/></span>
|
||||||
}</td>
|
}</td>
|
||||||
<td className={sgClassNames}
|
<td className={sgClassNames}
|
||||||
onMouseEnter={termtip.bind(null, sgTooltip, { cap: 0 })}
|
onMouseEnter={termtip.bind(null, sgTooltip, { cap: 0 })}
|
||||||
onMouseLeave={hide}
|
onMouseLeave={hide}
|
||||||
@@ -226,21 +226,21 @@ export default class ShipSummaryTable extends TranslatedComponent {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{translate(shieldGenerator.readMeta('type') || 'No Shield')}</td>
|
<td>{translate(shieldGenerator.readMeta('type') || 'No Shield')}</td>
|
||||||
<td>{formats.pct1(1 - sgMetrics.explosive.damageMultiplier)}</td>
|
<td>{formats.pct1(1 - sgMetrics.explosive.damageMultiplier)}</td>
|
||||||
<td>{formats.pct1(1 - sgMetrics.kinetic.damageMultiplier)}</td>
|
<td>{formats.pct1(1 - sgMetrics.kinetic.damageMultiplier)}</td>
|
||||||
<td>{formats.pct1(1 - sgMetrics.thermal.damageMultiplier)}</td>
|
<td>{formats.pct1(1 - sgMetrics.thermal.damageMultiplier)}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
|
||||||
<td>{int(sgMetrics.shieldStrength || 0)}{u.MJ}</td>
|
<td>{int(sgMetrics.shieldStrength || 0)}{u.MJ}</td>
|
||||||
<td>{int(sgMetrics.shieldStrength / sgMetrics.explosive.damageMultiplier || 0)}{u.MJ}</td>
|
<td>{int(sgMetrics.shieldStrength / sgMetrics.explosive.damageMultiplier || 0)}{u.MJ}</td>
|
||||||
<td>{int(sgMetrics.shieldStrength / sgMetrics.kinetic.damageMultiplier || 0)}{u.MJ}</td>
|
<td>{int(sgMetrics.shieldStrength / sgMetrics.kinetic.damageMultiplier || 0)}{u.MJ}</td>
|
||||||
<td>{int(sgMetrics.shieldStrength / sgMetrics.thermal.damageMultiplier || 0)}{u.MJ}</td>
|
<td>{int(sgMetrics.shieldStrength / sgMetrics.thermal.damageMultiplier || 0)}{u.MJ}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>{formats.time(sgMetrics.recover) || translate('Never')}</td>
|
<td>{formats.time(sgMetrics.recover) || translate('Never')}</td>
|
||||||
<td>{formats.time(sgMetrics.recharge) || translate('Never')}</td>
|
<td>{formats.time(sgMetrics.recharge) || translate('Never')}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -252,7 +252,7 @@ export default class ShipSummaryTable extends TranslatedComponent {
|
|||||||
<th rowSpan={2} onMouseEnter={termtip.bind(null, 'TT_MODULE_PROTECTION_INTERNAL', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('internal protection')}</th>
|
<th rowSpan={2} onMouseEnter={termtip.bind(null, 'TT_MODULE_PROTECTION_INTERNAL', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('internal protection')}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{`${translate('explosive')}`}</th>
|
<th>{`${translate('explosive')}`}</th>
|
||||||
<th>{`${translate('kinetic')}`}</th>
|
<th>{`${translate('kinetic')}`}</th>
|
||||||
<th>{`${translate('thermal')}`}</th>
|
<th>{`${translate('thermal')}`}</th>
|
||||||
<th>{`${translate('caustic')}`}</th>
|
<th>{`${translate('caustic')}`}</th>
|
||||||
|
|||||||
@@ -123,16 +123,16 @@ export default class Slider extends React.Component {
|
|||||||
/**
|
/**
|
||||||
* Touch start handler
|
* Touch start handler
|
||||||
* @param {Event} event DOM Event
|
* @param {Event} event DOM Event
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
_touchstart(event) {
|
_touchstart(event) {
|
||||||
this.touchStartTimer = setTimeout(() => this.sliderInputBox._setDisplay('block'), 1500);
|
this.touchStartTimer = setTimeout(() => this.sliderInputBox._setDisplay('block'), 1500);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Touch end handler
|
* Touch end handler
|
||||||
* @param {Event} event DOM Event
|
* @param {Event} event DOM Event
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
_touchend(event) {
|
_touchend(event) {
|
||||||
this.sliderInputBox.sliderVal.focus();
|
this.sliderInputBox.sliderVal.focus();
|
||||||
@@ -212,7 +212,7 @@ export default class Slider extends React.Component {
|
|||||||
let margin = MARGIN_LR * scale;
|
let margin = MARGIN_LR * scale;
|
||||||
let width = outerWidth - (margin * 2);
|
let width = outerWidth - (margin * 2);
|
||||||
let pctPos = width * this.props.percent;
|
let pctPos = width * this.props.percent;
|
||||||
return <div><svg
|
return <div><svg
|
||||||
onMouseUp={this._up} onMouseEnter={this._enter.bind(this)} onMouseMove={this._move} onKeyUp={this._keyup} onKeyDown={this._keydown} style={style} ref={node => this.node = node} tabIndex="0">
|
onMouseUp={this._up} onMouseEnter={this._enter.bind(this)} onMouseMove={this._move} onKeyUp={this._keyup} onKeyDown={this._keydown} style={style} ref={node => this.node = node} tabIndex="0">
|
||||||
<rect className='primary' style={{ opacity: 0.3 }} x={margin} y='0.25em' rx='0.3em' ry='0.3em' width={width} height='0.7em' />
|
<rect className='primary' style={{ opacity: 0.3 }} x={margin} y='0.25em' rx='0.3em' ry='0.3em' width={width} height='0.7em' />
|
||||||
<rect className='primary-disabled' x={margin} y='0.45em' rx='0.15em' ry='0.15em' width={pctPos} height='0.3em' />
|
<rect className='primary-disabled' x={margin} y='0.45em' rx='0.15em' ry='0.15em' width={pctPos} height='0.3em' />
|
||||||
@@ -231,7 +231,7 @@ export default class Slider extends React.Component {
|
|||||||
scale={this.props.scale}
|
scale={this.props.scale}
|
||||||
max={this.props.max}
|
max={this.props.max}
|
||||||
/>
|
/>
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -269,14 +269,14 @@ class TextInputBox extends React.Component {
|
|||||||
this.setState({ inputValue: nextValue });
|
this.setState({ inputValue: nextValue });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Update slider textbox visibility/values if changes are made to slider
|
* Update slider textbox visibility/values if changes are made to slider
|
||||||
* @param {Object} prevProps React Component properites
|
* @param {Object} prevProps React Component properites
|
||||||
* @param {Object} prevState React Component state values
|
* @param {Object} prevState React Component state values
|
||||||
*/
|
*/
|
||||||
componentDidUpdate(prevProps, prevState) {
|
componentDidUpdate(prevProps, prevState) {
|
||||||
if (prevState.divStyle.display == 'none' && this.state.divStyle.display == 'block') {
|
if (prevState.divStyle.display == 'none' && this.state.divStyle.display == 'block') {
|
||||||
this.enterTimer = setTimeout(() => this.sliderVal.focus(), 10);
|
this.enterTimer = setTimeout(() => this.sliderVal.focus(), 10);
|
||||||
}
|
}
|
||||||
if (prevProps.max !== this.props.max && this.state.inputValue > this.props.max) {
|
if (prevProps.max !== this.props.max && this.state.inputValue > this.props.max) {
|
||||||
// they chose a different module
|
// they chose a different module
|
||||||
@@ -287,14 +287,14 @@ class TextInputBox extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Set initial state for the textbox.
|
* Set initial state for the textbox.
|
||||||
* We may want to rethink this to
|
* We may want to rethink this to
|
||||||
* try and make it a stateless component
|
* try and make it a stateless component
|
||||||
* @returns {object} React state object with initial values set
|
* @returns {object} React state object with initial values set
|
||||||
*/
|
*/
|
||||||
_getInitialState() {
|
_getInitialState() {
|
||||||
return {
|
return {
|
||||||
divStyle: { display:'none' },
|
divStyle: { display:'none' },
|
||||||
inputStyle: { width:'4em' },
|
inputStyle: { width:'4em' },
|
||||||
labelStyle: { marginLeft: '.1em' },
|
labelStyle: { marginLeft: '.1em' },
|
||||||
maxLength:5,
|
maxLength:5,
|
||||||
@@ -307,7 +307,7 @@ class TextInputBox extends React.Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {string} val block or none
|
* @param {string} val block or none
|
||||||
*/
|
*/
|
||||||
_setDisplay(val) {
|
_setDisplay(val) {
|
||||||
@@ -339,7 +339,7 @@ class TextInputBox extends React.Component {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Get the value in the text box
|
* Get the value in the text box
|
||||||
* @returns {number} inputValue Value of the input box
|
* @returns {number} inputValue Value of the input box
|
||||||
*/
|
*/
|
||||||
_getValue() {
|
_getValue() {
|
||||||
return this.state.inputValue;
|
return this.state.inputValue;
|
||||||
@@ -348,7 +348,7 @@ class TextInputBox extends React.Component {
|
|||||||
* Update and set limits on input box
|
* Update and set limits on input box
|
||||||
* values depending on what user
|
* values depending on what user
|
||||||
* has selected
|
* has selected
|
||||||
*
|
*
|
||||||
* @param {SyntheticEvent} event ReactJs onChange event
|
* @param {SyntheticEvent} event ReactJs onChange event
|
||||||
*/
|
*/
|
||||||
_handleChange(event) {
|
_handleChange(event) {
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ export class OrbisIcon extends SvgIcon {
|
|||||||
<path d="m155.34 679.12 173.25-190.21-15.626-13.721-170.9 190.4zm31.01 31.714 202.41-169.1-16.418-14.417-198.76 170.43z"/>
|
<path d="m155.34 679.12 173.25-190.21-15.626-13.721-170.9 190.4zm31.01 31.714 202.41-169.1-16.418-14.417-198.76 170.43z"/>
|
||||||
<path d="m702.66 178.87-173.25 190.21 15.625 13.721 170.9-190.4zm-31.01-31.714-202.41 169.1 16.418 14.417 198.76-170.43z" />
|
<path d="m702.66 178.87-173.25 190.21 15.625 13.721 170.9-190.4zm-31.01-31.714-202.41 169.1 16.418 14.417 198.76-170.43z" />
|
||||||
<rect transform="matrix(-.7071 -.7071 .7071 -.7071 429.34 1036.2)" x="387.09" y="420.77" width="84.379" height="16.859" />
|
<rect transform="matrix(-.7071 -.7071 .7071 -.7071 429.34 1036.2)" x="387.09" y="420.77" width="84.379" height="16.859" />
|
||||||
</g>);
|
</g>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -741,9 +741,9 @@ export class Modified extends SvgIcon {
|
|||||||
*/
|
*/
|
||||||
svg() {
|
svg() {
|
||||||
return <g>
|
return <g>
|
||||||
<path d="M100,5L18,52.5L18,147.5L100,195L182,147.5L182,52.5L100,5Z"/>
|
<path d="M100,5L18,52.5L18,147.5L100,195L182,147.5L182,52.5L100,5Z"/>
|
||||||
<path d="M100,70L74,85L74,115L100,130L126,115L126,85L100,70Z"/>
|
<path d="M100,70L74,85L74,115L100,130L126,115L126,85L100,70Z"/>
|
||||||
</g>;
|
</g>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import TranslatedComponent from './TranslatedComponent';
|
|||||||
* Document Root Tooltip
|
* Document Root Tooltip
|
||||||
*/
|
*/
|
||||||
export default class Tooltip extends TranslatedComponent {
|
export default class Tooltip extends TranslatedComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
rect: PropTypes.object.isRequired,
|
rect: PropTypes.object.isRequired,
|
||||||
options: PropTypes.object
|
options: PropTypes.object
|
||||||
@@ -127,5 +126,4 @@ export default class Tooltip extends TranslatedComponent {
|
|||||||
</div>
|
</div>
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { shallowEqual } from '../utils/UtilityFunctions';
|
|||||||
* Abstract Translated Component
|
* Abstract Translated Component
|
||||||
*/
|
*/
|
||||||
export default class TranslatedComponent extends React.Component {
|
export default class TranslatedComponent extends React.Component {
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
language: PropTypes.object.isRequired,
|
language: PropTypes.object.isRequired,
|
||||||
sizeRatio: PropTypes.number.isRequired,
|
sizeRatio: PropTypes.number.isRequired,
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import PropTypes from 'prop-types';
|
|||||||
* Unexpected Error page / block
|
* Unexpected Error page / block
|
||||||
*/
|
*/
|
||||||
export default class ErrorDetails extends React.Component {
|
export default class ErrorDetails extends React.Component {
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
route: PropTypes.object.isRequired,
|
route: PropTypes.object.isRequired,
|
||||||
language: PropTypes.object.isRequired
|
language: PropTypes.object.isRequired
|
||||||
@@ -46,7 +45,7 @@ export default class ErrorDetails extends React.Component {
|
|||||||
<h1>Jameson, we have a problem..</h1>
|
<h1>Jameson, we have a problem..</h1>
|
||||||
<h1><small>{error.message}</small></h1>
|
<h1><small>{error.message}</small></h1>
|
||||||
<br/>
|
<br/>
|
||||||
{importerror ? <div>If you are attempting to import a ship from EDDI or EDMC and are seeing a 'Z_BUF_ERROR' it means that the URL has not been provided correctly. This is a common problem when using Microsoft Internet Explorer or Microsoft Edge, and you should use another browser instead.</div> : null }
|
{importerror ? <div>If you are attempting to import a ship from EDDI or EDMC and are seeing a 'Z_BUF_ERROR' it means that the URL has not been provided correctly. This is a common problem when using Microsoft Internet Explorer or Microsoft Edge, and you should use another browser instead.</div> : null }
|
||||||
<br/>
|
<br/>
|
||||||
<div>Please note that this site uses Google Analytics to track performance and usage. If you are blocking cookies, for example using Ghostery, please disable blocking for this site and try again.</div>
|
<div>Please note that this site uses Google Analytics to track performance and usage. If you are blocking cookies, for example using Ghostery, please disable blocking for this site and try again.</div>
|
||||||
<br/>
|
<br/>
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { shallowEqual } from '../utils/UtilityFunctions';
|
|||||||
* Abstract/Base Page
|
* Abstract/Base Page
|
||||||
*/
|
*/
|
||||||
export default class Page extends React.Component {
|
export default class Page extends React.Component {
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
closeMenu: PropTypes.func.isRequired,
|
closeMenu: PropTypes.func.isRequired,
|
||||||
hideModal: PropTypes.func.isRequired,
|
hideModal: PropTypes.func.isRequired,
|
||||||
@@ -84,5 +83,4 @@ export default class Page extends React.Component {
|
|||||||
}
|
}
|
||||||
return this.renderPage();
|
return this.renderPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user