Skip to content

Commit

Permalink
feat: v0.6.8 update (#30)
Browse files Browse the repository at this point in the history
* chore: add documentation links

* fix: properly align currency in the aircraft profit dashboard

* feat: add currency format helper

* chore: load helpers in /action/ pages

* fix(#12): change indicator color based on positive/negative values

* fix: check for value in fltmng_getAircraftId function

* fix(#11): properly format large numbers in flightInfo

* fix(#14): add table width css

* fix(#13): add some improved colours for dark mode

* fix(#10): right align flight info currency columns

* chore: cleanup the manifest content_scripts

* fix: filter out NaN dates for “Schedule extract 'days ago'”

* fix(#16): check date type for route management data

* fix: prevent NaN dates

* fix: filter NaN dates in getRouteAnalysisImportantDates

* feat: move getAirlineCode and getServerName to helper.js

* chore: change arrow function to method

* feat: move formatDate to helpers.js as formatDateString

fix: check if date is provided, else return

* feat: move formatWeekDate to helpers.js as formatDateStringWeek

* feat: move getDateDiff to helpers.js

* chore: fix typo and add credits for myself

* chore: bump version number

* style: convert line endings to LF

* chore: inventory analysis js file style (#24)

* fix: only push dates if they’re integers

* style: format according to .editorconfig

* feat: renovate inventory analysis (#25)

Fixes:
- data comparison resulting in invalid results
- no new flight pair data being written
- Several components have been refactored and/or ported to vanilla JavaScript:

Features:
- settings are now loaded on page load
- getServer() is now loaded from AES (helpers.js)
- validation of the inventory settings is now in its own file / its own component (instead of an object)

UI clean-up:
- columns with numbers are right aligned
- historical data now starts with newest data on the left
- table cells no longer wrap, giving a cleaner more comprehensible look

Commits:
* feat: move cleanInteger to helpers.js
* refactor: getFlights
  * split out into multiple functions
  * port to vanilla
  * add jsdoc
* refactor: getPriceDetails
  * port to vanilla
  * add jsdoc
  * split into multiple functions
* refactor: inventory initialisation
* refactor: displayInventory
  * displayInventory now uses await to get local storage
* feat: fix historic data table styling / reverse order
* fix: get settings on page load
* refactor: remove getServer()
* refactor: use booleans instead of numbers
* refactor: pull inventory setting validation into its own class
  * The “content_inventory” file is quite long as it is. Pulling this validation out into its own file makes it easier to read.
* refactor: use early return when errors occur
* chore: add pricingDataObjectExample
* fix: correctly show price analysis

* fix(#26): replace getDate() with AES.getServerDate() (#27)

Removes all the duplicate getDate() functions with one centralised getServerDate() helper function.

* fix: remove redundant helper functions (#29)

* fix(#28): remove all duplicates of cleanInteger()

* fix(#28): remove duplicates of getDateDiff

* fix(#28): remove duplicates of formatDate

formatDate has been replaced by AES.formatDateString

* fix: simplify cleanInteger

* fix: correct date extraction

Apparently the footer date element is not consistently styled across all pages. This corrects for that.

* style: apply .editorconfig to content_dashboard

* feat: add AES menu (#32)

* feat: add AES menu

Adds a menu item to the main game menu. Provides easy access to the forum topic and reporting bugs.

* fix: consistently align icons in menu

* feat: add support for menu dividers and headers

* feat: add a few menu items

* fix: correctly escape url

* feat: add support for modal toggle menuitems

* feat(#33): add about screen (#34)

* feat(#33): add about window

* feat(#33): add logo to about screen

* feat(#33): improve dialog styling

* feat(#33): simplify code / improve close button

* fix: correct heading colour in about screen
  • Loading branch information
ZoeBijl authored Jun 9, 2024
1 parent 6a8b3e9 commit e483810
Show file tree
Hide file tree
Showing 16 changed files with 5,512 additions and 5,054 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AirlineSim Enhancement Suite

The AirlineSime Enhancement Suite (AES) offers a set of tools to help CEOs build their airlines.
The AirlineSim Enhancement Suite (AES) offers a set of tools to help CEOs build their airlines.

## Features

Expand All @@ -18,7 +18,6 @@ Marcipanas wrote [a guide](https://docs.google.com/document/d/1hzMHb3hTBXSZNtuDK
## Installation

Supported platforms: chromium based browsers (Chrome, Edge, etc)

Please follow [racsofp’s guide](https://forums.airlinesim.aero/t/manual-installation-of-the-ase-airlinesim-enhancement-suite-chrome-extension/24671)

## History
Expand All @@ -34,3 +33,4 @@ Sources: the [original forum thread](https://forums.airlinesim.aero/t/introducin
- Marcipanas for the original development
- racsofp for their update and installation documentation
- Robert73 for the updated manifest file
- Zoë Bijl for the continued development
56 changes: 56 additions & 0 deletions docs/pricingDataObjectExample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
"20240403": {
"data": {
"C": {
"analysisPrice": 0,
"analysisPricePoint": 0,
"currentPrice": 467,
"currentPricePoint": 100,
"recommendation": 0,
"totalBkd": 0,
"totalCap": 0,
"useCurrentPrice": 0,
"valid": 0
},
"Cargo": {
"analysisPrice": 139,
"analysisPricePoint": 100,
"currentPrice": 139,
"currentPricePoint": 100,
"index": 39,
"newPrice": 128,
"newPriceChange": -8,
"newPricePoint": 92,
"recType": "bad",
"recommendation": "Drop High",
"totalBkd": 13,
"totalCap": 72,
"useCurrentPrice": 1,
"valid": 1
},
"F": {
"analysisPrice": 0,
"analysisPricePoint": 0,
"currentPrice": 859,
"currentPricePoint": 100,
"recommendation": 0,
"totalBkd": 0,
"totalCap": 0,
"useCurrentPrice": 0,
"valid": 0
},
"Y": {
"analysisPrice": 0,
"analysisPricePoint": 0,
"currentPrice": 203,
"currentPricePoint": 100,
"recommendation": 0,
"totalBkd": 0,
"totalCap": 0,
"useCurrentPrice": 0,
"valid": 0
}
},
"date": 20240403,
"pricingUpdated": 1,
"updateTime": "14:36 UTC"
}
39 changes: 3 additions & 36 deletions extension/content_aircraftFlights.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function displayFlightProfit(){

if(value.data){
td.push(formatMoney(value.data.money.CM5.Total));
td.push($('<td></td>').text(formatDate(value.data.date)+' '+value.data.time));
td.push($('<td></td>').text(AES.formatDateString(value.data.date)+' '+value.data.time));
} else {
td.push('<td></td>');
td.push('<td></td>');
Expand All @@ -137,7 +137,7 @@ function buildTable(){
row.push($('<tr></tr>').append('<th>Total flights</th>','<td>'+aircraftFlightData.totalFlights+'</td>'));
row.push($('<tr></tr>').append('<th>Finished flights</th>','<td>'+aircraftFlightData.finishedFlights+'</td>'));
row.push($('<tr></tr>').append('<th>Finished flights with profit/loss extract</th>','<td>'+aircraftFlightData.profitFlights+'</td>'));
row.push($('<tr></tr>').append('<th>Data save time</th>','<td>'+formatDate(aircraftFlightData.date)+' '+aircraftFlightData.time+'</td>'));
row.push($('<tr></tr>').append('<th>Data save time</th>','<td>'+AES.formatDateString(aircraftFlightData.date)+' '+aircraftFlightData.time+'</td>'));

let tbody = $('<tbody></tbody>').append(row);
return $('<table class="table table-bordered table-striped table-hover"></table>').append(tbody);
Expand All @@ -146,7 +146,7 @@ function getData(){
//Aircraft ID
let aircraftId = getAircraftId();
let aircraftInfo = getAircraftInfo();
let date = getDate();
let date = AES.getServerDate()
let server = getServerName();
let flights = getFlights();
let flightsStats = getFlightsStats(flights);
Expand Down Expand Up @@ -235,39 +235,6 @@ function formatMoney(value){

return container
}
function formatDate(date){
return date.substring(0, 4)+'-'+date.substring(4, 6)+'-'+date.substring(6, 8);
}
function getDate(){
let a = $(".as-footer-line-element:has('.fa-clock-o')").text().trim();
let b = a.split(" ");
//For date
let dateTemp = b[0].split("-");
let date;
if(dateTemp.length == 1){
//German
dateTemp = dateTemp[0].split(".");
date = dateTemp.map(function(value){
return value.replace(/[^A-Za-z0-9]/g, '');
});
date = date[2] + date[1] + date[0];
} else {
//English
date = dateTemp.map(function(value){
return value.replace(/[^A-Za-z0-9]/g, '');
});
date = date[0] + date[1] + date[2];
}
//For time
let time = b[b.length-2] +' '+b[b.length-1];
return {date:date,time:time};
}
function cleanInteger(a){
a = a.replace(',','');
a = a.replace('.','');
a = a.replace(' AS$','');
return parseInt(a, 10);
}
function getServerName(){
let server = window.location.hostname
server = server.split('.');
Expand Down
Loading

0 comments on commit e483810

Please sign in to comment.