From 80f64fd6d689dfa5d8e05382f3aa2f1ef01a1f72 Mon Sep 17 00:00:00 2001 From: Nate Geslin Date: Mon, 14 Nov 2016 18:39:26 -0600 Subject: [PATCH 1/2] feature/ATC-88 - Adds iief and additional script tag to index.html that allows for an airportLoadList isolated from the bundle and editable without re-bundling. * Removes src/**/airportLoadList * Updates AirportController to use new window var --- assets/airports/airportLoadList.js | 345 ++++++++++++++++++ index.html | 1 + .../scripts/airport/AirportController.js | 8 +- src/assets/scripts/airport/airportLoadList.js | 335 ----------------- 4 files changed, 351 insertions(+), 338 deletions(-) create mode 100644 assets/airports/airportLoadList.js delete mode 100644 src/assets/scripts/airport/airportLoadList.js diff --git a/assets/airports/airportLoadList.js b/assets/airports/airportLoadList.js new file mode 100644 index 00000000..222676a7 --- /dev/null +++ b/assets/airports/airportLoadList.js @@ -0,0 +1,345 @@ +/** + * This file lives outside of normal javascript bundle. This provides a way for contributors to add or remove + * airports without the need to re-build the entire app. This means a contributor does not need to have node + * installed in order to contribute. + * + * While not ideal, adding more things to the window, this does get around the need to re-bundle when making changes + * to the list of airports. + * + * This property is used by the `AirportController` and should be used only one time on app instantiation. + * + * @property AIRPORT_LOAD_LIST + * @return {array} + */ +window.AIRPORT_LOAD_LIST = (function() { // eslint-disable-line wrap-iife + /** + * List of airports to load. + * + * If you are adding a new airport to the game, be sure to include: + * + * - the airport json file in `assets/airports/AIRPORT_NAME.json` where `AIRPORT_NAME` is + * the airport icao. (ex: KSFO would be `assets/airports/ksfo.json`) + * - the terrain geojson file (if one exists) in `assets/airports/terrain/AIRPORT_NAME.geojson` + * where `AIRPORT_NAME` is the airport icao. (ex: KSFO would be `assets/airports/terrain/ksfo.geojson`) + * - add a new data block at the bottom of this file in the shape of: + * ``` + * { + * icao: {AIRPORT_ICAO}, + * level: {AIRPORT_DIFFICULTY}, + * name: {AIRPORT_NAME} + * } + * ``` + * - `AIRPORT_ICAO` is the airport icao in lowercase (ex: ksfo) + * - `AIRPORT_DIFFICULTY` is the difficulty level (one of: easy, beginner, medium, hard) + * - `AIRPORT_NAME` is the name of the airport (ex: San Francisco International Airport) + * If the airport is a work in progress, please include the icon character `⛿` after the `name` + * (see ebbr, kmsp or ksea): + * `name: 'Brussels-National ⛿'` + * + * @property AIRPORT_LOAD_LIST + * @type {Array} + * @final + */ + return [ + { + icao: 'ebbr', + level: 'easy', + name: 'Brussels-National ⛿' + }, + { + icao: 'eddf', + level: 'medium', + name: 'Frankfurt Airport' + }, + { + icao: 'eddh', + level: 'easy', + name: 'Hamburg Airport' + }, + { + icao: 'eddm', + level: 'beginner', + name: 'Franz Josef Strauß International Airport' + }, + { + icao: 'eddt', + level: 'medium', + name: 'Berlin Tegel Airport' + }, + { + icao: 'egcc', + level: 'hard', + name: 'Manchester Airport' + }, + { + icao: 'eggw', + level: 'medium', + name: 'London Luton Airport' + }, + { + icao: 'egkk', + level: 'easy', + name: 'London Gatwick Airport' + }, + { + icao: 'eglc', + level: 'medium', + name: 'London City Airport' + }, + { + icao: 'egll', + level: 'hard', + name: 'London Heathrow Airport' + }, + { + icao: 'egnm', + level: 'beginner', + name: 'Leeds Bradford International Airport' + }, + { + icao: 'eham', + level: 'medium', + name: 'Amsterdam Airport Schiphol' + }, + { + icao: 'eidw', + level: 'easy', + name: 'Dublin Airport' + }, + { + icao: 'einn', + level: 'easy', + name: 'Shannon Airport' + }, + { + icao: 'ekch', + level: 'medium', + name: 'Copenhagen Kastrup Airport' + }, + { + icao: 'engm', + level: 'easy', + name: 'Oslo Gardermoen International Airport' + }, + { + icao: 'espa', + level: 'easy', + name: 'Luleå Airport' + }, + { + icao: 'gcrr', + level: 'easy', + name: 'Lanzarote Airport' + }, + { + icao: 'kbos', + level: 'medium', + name: 'Boston Logan International Airport' + }, + { + icao: 'kdca', + level: 'medium', + name: 'Reagan National Airport' + }, + { + icao: 'kiad', + level: 'hard', + name: 'Washington-Dulles International Airport' + }, + { + icao: 'kjfk', + level: 'hard', + name: 'John F Kennedy International Airport ⛿' + }, + { + icao: 'klas', + level: 'medium', + name: 'McCarran International Airport' + }, + { + icao: 'klax90', + level: 'medium', + name: 'Los Angeles International Airport 1990' + }, + { + icao: 'klax', + level: 'medium', + name: 'Los Angeles International Airport' + }, + { + icao: 'kmia', + level: 'hard', + name: 'Miami International Airport ⛿' + }, + { + icao: 'kmsp', + level: 'hard', + name: 'Minneapolis/St. Paul International Airport ⛿' + }, + { + icao: 'kord', + level: 'hard', + name: 'Chicago O\'Hare International Airport' + }, + { + icao: 'kpdx', + level: 'easy', + name: 'Portland International Airport' + }, + { + icao: 'kphx', + level: 'easy', + name: 'Phoenix Sky Harbor International Airport' + }, + { + icao: 'ksan', + level: 'easy', + name: 'San Diego International Airport' + }, + { + icao: 'ksea', + level: 'medium', + name: 'Seattle-Tacoma International Airport ⛿' + }, + { + icao: 'ksfo', + level: 'medium', + name: 'San Francisco International Airport ⛿' + }, + { + icao: 'lkpr', + level: 'easy', + name: 'Vaclav Havel International Airport' + }, + { + icao: 'loww', + level: 'medium', + name: 'Vienna International Airport' + }, + { + icao: 'ltba', + level: 'hard', + name: 'Atatürk International Airport ⛿' + }, + { + icao: 'omaa', + level: 'medium', + name: 'Abu Dhabi International Airport' + }, + { + icao: 'omdb', + level: 'hard', + name: 'Dubai International Airport' + }, + { + icao: 'osdi', + level: 'easy', + name: 'Damascus International Airport' + }, + { + icao: 'othh', + level: 'hard', + name: 'Doha Hamad International Airport' + }, + { + icao: 'rjtt', + level: 'hard', + name: 'Tokyo Haneda International Airport' + }, + { + icao: 'rksi', + level: 'hard', + name: 'Incheon International Airport' + }, + { + icao: 'saez', + level: 'medium', + name: 'Aeropuerto Internacional Ministro Pistarini' + }, + { + icao: 'same', + level: 'medium', + name: 'Aeropuerto Internacional El Plumerillo' + }, + { + icao: 'sawh', + level: 'beginner', + name: 'Aeropuerto Internacional Malvinas Argentinas' + }, + { + icao: 'sbgl', + level: 'beginner', + name: 'Aeroporto Internacional Tom Jobim' + }, + { + icao: 'sbgr', + level: 'beginner', + name: 'Aeroporto Internacional de São Paulo/Guarulhos' + }, + { + icao: 'tjsj', + level: 'easy', + name: 'Luis Muñoz Marín International Airport' + }, + { + icao: 'tncm', + level: 'easy', + name: 'Princess Juliana International Airport' + }, + { + icao: 'uudd', + level: 'easy', + name: 'Moscow Domodedovo Airport' + }, + { + icao: 'vabb', + level: 'hard', + name: 'Chhatrapati Shivaji International Airport' + }, + { + icao: 'vecc', + level: 'medium', + name: 'Kolkata Netaji Subhas Chandra Bose Int\'l' + }, + { + icao: 'vhhh', + level: 'medium', + name: 'Hong Kong Chep Lap Kok International Airport' + }, + { + icao: 'vidp', + level: 'hard', + name: 'Indira Gandhi International Airport' + }, + { + icao: 'wiii', + level: 'medium', + name: 'Soekarno-Hatta International Airport' + }, + { + icao: 'wimm', + level: 'easy', + name: 'Kuala Namu International Airport' + }, + { + icao: 'wmkp', + level: 'medium', + name: 'Pulau Pinang International Airport' + }, + { + icao: 'wmkk', + level: 'hard', + name: 'Kuala Lumpur International Airport (KLIA)' + }, + { + icao: 'wsss', + level: 'hard', + name: 'Singapore Changi International Airport' + }, + { + icao: 'zspd', + level: 'hard', + name: 'Shanghai Pudong International Airport' + } + ]; +})(); diff --git a/index.html b/index.html index 6eb9d7c8..f10731d2 100644 --- a/index.html +++ b/index.html @@ -72,6 +72,7 @@ +