Skip to content

Commit

Permalink
Add fixes for #102
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-dolkens committed Dec 28, 2022
1 parent 829f2be commit 5dc3019
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/web_resources/HangarXPLOR.Download.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ HangarXPLOR._exportByName = HangarXPLOR._exportByName || {};
return $('.kind:contains(Ship)', this).parent().map(function() {
var $ship = this;
var ship_name = $('.title', $ship).text().trim();
ship_name = ship_name.replace(/^(?:Aegis|Anvil|Aopoa|Banu|CNOU|Crusader|Drake|Greycat Industrial|Esperia|Kruger|MISC|Origin|RSI|Tumbril|Vanduul|Xi'an)[^a-z0-9]+/gi, '').trim();
ship_name = ship_name.replace(/^(?:Aegis|Anvil|Aopoa|Banu|CNOU|Crusader|Drake|Greycat Industrial|Greycat|Esperia|Kruger|MISC|Origin|RSI|Tumbril|Vanduul|Xi'an)[^a-z0-9]+/gi, '').trim();
var lookup = ship_name.toLowerCase();
var nickname = $('.custom-name-text', $ship).text();
var i, j;
Expand All @@ -54,6 +54,7 @@ HangarXPLOR._exportByName = HangarXPLOR._exportByName || {};
unidentified: 'Please report this ship to the plugin developers at https://github.com/dolkensp/HangarXPLOR/issues',
ship_code: ($('.liner span', $ship).text().trim() + '_' + ship_name).replace(/[^a-z0-9]/gi, '_').replace(/__+/gi, '_'),
manufacturer_name: $('.liner', $ship).text().trim().replace(/\(.*\)/, '').trim(),
lookup: lookup,
};

ship.manufacturer_code = $('.liner span', $ship).text().trim();
Expand Down
23 changes: 22 additions & 1 deletion src/web_resources/HangarXPLOR.Ships.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var HangarXPLOR = HangarXPLOR || {};
* name: The name as expected from hangar
* displayName: The name as displayed by HangarXPLOR
* thumbnail: The thumbnail displayed by HangarXPLOR
* export: Redirect export to another populated ship profile
*
* url: The url of the details page
* focus: The focus of the ship
Expand Down Expand Up @@ -39,6 +40,18 @@ HangarXPLOR._ships = {
export: 'F8C Lightning'
// thumbnail: '/media/ldeqyuto9lb46r/heap_infobox/F8C-Executive.png'
},
'A1 Spirit': {
name: 'A1 Spirit',
export: 'Spirit A1'
},
'C1 Spirit': {
name: 'C1 Spirit',
export: 'Spirit C1'
},
'E1 Spirit': {
name: 'E1 Spirit',
export: 'Spirit E1'
},
'A2 Hercules': {
name: 'Hercules Starlifter A2'
},
Expand All @@ -48,6 +61,14 @@ HangarXPLOR._ships = {
'M2 Hercules': {
name: 'Hercules Starlifter M2'
},
'Genesis': {
name: 'Genesis Starliner',
export: 'Genesis Starliner'
},
'Mercury': {
name: 'Mercury Star Runner',
export: 'Mercury Star Runner'
},
'Caterpillar Pirate Edition': {
name: 'Caterpillar Pirate',
displayName: 'Caterpillar Pirate Edition',
Expand All @@ -63,7 +84,7 @@ HangarXPLOR._ships = {
export: '600i'
},
'600i Touring': {
name: '600i Touring Module',
name: '600i Touring Module',
export: '600i Touring'
},
'Argo Mole Talus Edition': {
Expand Down
16 changes: 14 additions & 2 deletions src/web_resources/ship-codes.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,12 @@
"manufacturer_code": "DRAK",
"manufacturer_name": "Drake Interplanetary"
},
{
"ship_code": "DRAK_Cutter",
"ship_name": "Cutter",
"manufacturer_code": "DRAK",
"manufacturer_name": "Drake Interplanetary"
},
{
"ship_code": "DRAK_Dragonfly",
"ship_name": "Dragonfly Black",
Expand Down Expand Up @@ -829,7 +835,7 @@
},
{
"ship_code": "ORIG_600i",
"ship_name": "600i Explorer",
"ship_name": "600i",
"manufacturer_code": "ORIG",
"manufacturer_name": "Origin Jumpworks"
},
Expand Down Expand Up @@ -971,6 +977,12 @@
"manufacturer_code": "RSI",
"manufacturer_name": "Roberts Space Industries"
},
{
"ship_code": "RSI_Galaxy",
"ship_name": "Galaxy",
"manufacturer_code": "RSI",
"manufacturer_name": "Roberts Space Industries"
},
{
"ship_code": "RSI_Mantis",
"ship_name": "Mantis",
Expand Down Expand Up @@ -1105,7 +1117,7 @@
},
{
"ship_code": "XIAN_Santok_yai",
"ship_name": "San'tok.yai",
"ship_name": "San'tok.yāi",
"manufacturer_code": "XIAN",
"manufacturer_name": "Aopoa"
},
Expand Down

0 comments on commit 5dc3019

Please sign in to comment.