Skip to content

Commit

Permalink
- new tooltips for wormhole information in signature table, closed #390
Browse files Browse the repository at this point in the history
- new "search" field for wormhole types in signature table, closed #652
- improved keyboard control, closed #266
  • Loading branch information
exodus4d committed Aug 10, 2018
1 parent f0f6d6d commit 958b773
Show file tree
Hide file tree
Showing 29 changed files with 526 additions and 294 deletions.
4 changes: 4 additions & 0 deletions app/main/controller/api/map.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ public function initData(\Base $f3){
foreach($rows as $rowData){
$wormholesData[$rowData->name] = $rowData->getData();
}

$wormhole->reset();
$wormhole->name = 'K162';
$wormholesData[$wormhole->name] = $wormhole->getData();
}
$return->wormholes = $wormholesData;

Expand Down
14 changes: 7 additions & 7 deletions js/app/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ define(['jquery'], ($) => {
5: 'C008 - C5',
6: 'G008 - C6',
7: 'Q003 - 0.0',
8: 'A009 - SH'
8: 'A009 - C13'
},
2: { // C2
1: 'E004 - C1',
Expand All @@ -416,7 +416,7 @@ define(['jquery'], ($) => {
5: 'C008 - C5',
6: 'G008 - C6',
7: 'Q003 - 0.0',
8: 'A009 - SH'
8: 'A009 - C13'
},
3: { // C3
1: 'E004 - C1',
Expand All @@ -426,7 +426,7 @@ define(['jquery'], ($) => {
5: 'C008 - C5',
6: 'G008 - C6',
7: 'Q003 - 0.0',
8: 'A009 - SH'
8: 'A009 - C13'
},
4: { // C4
1: 'E004 - C1',
Expand All @@ -436,7 +436,7 @@ define(['jquery'], ($) => {
5: 'C008 - C5',
6: 'G008 - C6',
7: 'Q003 - 0.0',
8: 'A009 - SH'
8: 'A009 - C13'
},
5: { // C5
1: 'E004 - C1',
Expand All @@ -446,7 +446,7 @@ define(['jquery'], ($) => {
5: 'C008 - C5',
6: 'G008 - C6',
7: 'Q003 - 0.0',
8: 'A009 - SH'
8: 'A009 - C13'
},
6: { // C6
1: 'E004 - C1',
Expand All @@ -456,7 +456,7 @@ define(['jquery'], ($) => {
5: 'C008 - C5',
6: 'G008 - C6',
7: 'Q003 - 0.0',
8: 'A009 - SH'
8: 'A009 - C13'
},
13: { // Shattered Wormholes (some of them are static)
1: 'E004 - C1',
Expand All @@ -466,7 +466,7 @@ define(['jquery'], ($) => {
5: 'C008 - C5',
6: 'G008 - C6',
7: 'Q003 - 0.0',
8: 'A009 - SH'
8: 'A009 - C13'
}
},
// incoming wormholes
Expand Down
6 changes: 3 additions & 3 deletions js/app/map/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ define([
orderable: true,
title: '<span title="jumps" data-toggle="tooltip">&nbsp;</span>',
width: '1px',
className: ['pf-help-default', 'text-center'].join(' '),
className: [Util.config.helpDefaultClass, 'text-center'].join(' '),
data: 'jumps',
render: {
_: function(data, type, row, meta){
Expand All @@ -428,7 +428,7 @@ define([
orderable: false,
title: '',
width: '26px',
className: ['pf-help-default', 'text-center', config.tableCellImageClass].join(' '),
className: [Util.config.helpDefaultClass, 'text-center', config.tableCellImageClass].join(' '),
data: 'log.ship',
render: {
_: function(data, type, row, meta){
Expand Down Expand Up @@ -478,7 +478,7 @@ define([
orderable: false,
title: '',
width: '10px',
className: ['pf-help-default'].join(' '),
className: [Util.config.helpDefaultClass].join(' '),
data: 'log',
render: {
_: function(data, type, row, meta){
Expand Down
21 changes: 16 additions & 5 deletions js/app/map/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -1438,9 +1438,13 @@ define([
let data = {};
if(tooltipData.massTotal){
data.massTotal = Util.formatMassValue(tooltipData.massTotal);
}else{
data.massTotal = '<span class="txt-color txt-color-grayLight">unknown</span>';
}
if(tooltipData.massIndividual){
data.massIndividual = Util.formatMassValue(tooltipData.massIndividual);
}else{
data.massIndividual = '<span class="txt-color txt-color-grayLight">unknown</span>';
}
if(tooltipData.massRegeneration){
data.massRegeneration = Util.formatMassValue(tooltipData.massRegeneration);
Expand All @@ -1451,14 +1455,21 @@ define([
if(tooltipData.signatureStrength){
data.signatureStrength = parseFloat(tooltipData.signatureStrength).toLocaleString() + '&nbsp;&#37;';
}else{
data.signatureStrength = 'unknown';
data.signatureStrength = '<span class="txt-color txt-color-grayLight">unknown</span>';
}
if(!tooltipData.class){
tooltipData.class = Util.getSecurityClassForSystem(tooltipData.security);

let title = tooltipData.name;

if(tooltipData.security){
// K162 has no security

if(!tooltipData.class){
tooltipData.class = Util.getSecurityClassForSystem(tooltipData.security);
}

title += '<span class="pull-right ' + tooltipData.class +'">' + tooltipData.security + '</span>';
}

let title = tooltipData.name +
'<span class="pull-right ' + tooltipData.class +'">' + tooltipData.security + '</span>';
let content = Mustache.render(template, data);

let defaultOptions = {
Expand Down
16 changes: 8 additions & 8 deletions js/app/ui/connection_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ define([
$('<thead>').append(
$('<tr>').append(
$('<th>', {
class: ['pf-table-cell-20', 'text-right', 'pf-help', 'pf-pie-chart'].join(' ')
class: ['pf-table-cell-20', 'text-right', Util.config.helpClass, 'pf-pie-chart'].join(' ')
}).attr('data-toggle', 'tooltip').attr('data-percent', '-100').easyPieChart({
barColor: (percent) => {
let color = '#e28a0d';
Expand Down Expand Up @@ -180,7 +180,7 @@ define([
$('<tbody>').append(
$('<tr>').append(
$('<td>', {
class: ['text-right', 'pf-help', config.connectionInfoTableCellMassTotalTooltipClass].join(' '),
class: ['text-right', Util.config.helpClass, config.connectionInfoTableCellMassTotalTooltipClass].join(' '),
html: '<i class="fas fa-fw fa-question-circle"></i>'
}),
$('<td>', {
Expand All @@ -196,7 +196,7 @@ define([
),
$('<tr>').append(
$('<td>', {
class: ['text-right', 'pf-help'].join(' '),
class: ['text-right', Util.config.helpClass].join(' '),
html: '<i class="fas fa-fw fa-question-circle"></i>',
title: 'initial mass. From signature table'
}).attr('data-toggle', 'tooltip'),
Expand All @@ -211,7 +211,7 @@ define([
class: config.connectionInfoTableRowMassLogClass
}).append(
$('<td>', {
class: ['text-right', 'pf-help'].join(' '),
class: ['text-right', Util.config.helpClass].join(' '),
title: 'recorded total jump mass'
}).attr('data-toggle', 'tooltip').append(
$('<i>', {
Expand Down Expand Up @@ -245,7 +245,7 @@ define([
class: config.connectionInfoTableRowMassShipClass
}).append(
$('<td>', {
class: ['text-right', 'pf-help'].join(' '),
class: ['text-right', Util.config.helpClass].join(' '),
title: 'current ship mass'
}).attr('data-toggle', 'tooltip').append(
$('<i>', {
Expand All @@ -269,7 +269,7 @@ define([
),
$('<tr>').append(
$('<td>', {
class: ['text-right', 'pf-help'].join(' '),
class: ['text-right', Util.config.helpClass].join(' '),
html: '<i class="fas fa-fw fa-question-circle"></i>',
title: 'max. mass left'
}).attr('data-toggle', 'tooltip'),
Expand Down Expand Up @@ -697,7 +697,7 @@ define([
title: '',
width: 26,
orderable: false,
className: ['pf-help-default', 'text-center', config.tableCellImageClass].join(' '),
className: [Util.config.helpDefaultClass, 'text-center', config.tableCellImageClass].join(' '),
data: 'ship',
render: {
_: function(data, type, row){
Expand All @@ -716,7 +716,7 @@ define([
title: '',
width: 26,
orderable: false,
className: ['pf-help-default', 'text-center', config.tableCellImageClass].join(' '),
className: [Util.config.helpDefaultClass, 'text-center', config.tableCellImageClass].join(' '),
data: 'created.character',
render: {
_: function(data, type, row){
Expand Down
6 changes: 6 additions & 0 deletions js/app/ui/dialog/jump_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ define([
}
};
},
formatTime: function(){
return function(value, render){
let time = render(value);
return time.length ? time + '&nbsp;h' : 'unknown';
};
},
sigStrengthValue: function(){
return function(value, render){
let float = render(value);
Expand Down
2 changes: 1 addition & 1 deletion js/app/ui/dialog/map_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ define([
width: 26,
orderable: false,
searchable: false,
className: ['pf-help-default', 'text-center', config.tableCellImageClass].join(' '),
className: [Util.config.helpDefaultClass, 'text-center', config.tableCellImageClass].join(' '),
data: 'log.ship',
defaultContent: '',
render: {
Expand Down
Loading

0 comments on commit 958b773

Please sign in to comment.