Class: exportImportProjects

exportImportProjects

new exportImportProjects()

Class for saving and loading manoeuvre strings. Can use local storage as well as allowing inputs from JSON, and exports to JSON/ Local storage.
Source:

Methods

checkLocalStoragePermitted() → {Boolean}

Checks whether local storage is possible in the user's browser, else storing locally will not work.
Source:
Returns:
localStorage Whether local storage is possible.
Type
Boolean

exportToJSON(manoeuvres, element)

Creates JSON data from the OLAN entry, and then calls to start the JSON file download in the user's browser.
Parameters:
Name Type Description
manoeuvres String Input from the OLAN box representing the flight
element this The button which was pressed to initiate the export
Source:

exportToLocalStorage(manoeuvres)

Uses the provided manoeuvres string to set it to the browser's local storage under the name 'manoeuvres'.
Parameters:
Name Type Description
manoeuvres String Input from the OLAN box representing the flight
Source:

getAutoLoadLocal() → {Boolean}

Source:
Returns:
autoLoad Gets from the local storage whether auto-load is enabled.
Type
Boolean

getJSONImport() → {String}

Getter for returning the imported JSON file's OLAN input.
Source:
Returns:
movesString OLAN Input that was saved.
Type
String

importFromJSON(file)

Takes the file given from the user and gets the JSON data out of it for recieving the saved OLAN input.
Parameters:
Name Type Description
file File The file uploaded from the user
Source:

importFromLocalStorage() → {String}

Source:
Returns:
manoeuvres OLAN Input string that was saved.
Type
String

setAutoLoadLocal(autoload)

Sets the value from the checkbox for auto back-up of input of OLAN from the user, storing the value in local storage under 'autoload'.
Parameters:
Name Type Description
autoload Boolean True or false if the browser should auto-remember user input
Source: