This is part of GoCloudStorage and not part of the main GoJS library. Storage can be found in the GoJS kit under the projects
folder. See the Storage intro page for more information.
An array of GoJS Diagrams whose model(s) will be saved to / loaded from Local Storage. Can also be a single Diagram.
String representation of the default model data for new diagrams. If this is null, default new diagrams will be empty. Usually a value given by calling Model.toJson on a GoJS Diagram's Model.
The directory path relative to the page in which this instance of GoLocalStorage exists, in which the storage service brand icons can be found. The default value is "../goCloudStorageIcons/".
Get the browser window's Local Storage property.
Check if Local Storage is supported by the current browser.
This parameter can be ignored. It exists only to maintain GoCloudStorage system structure
Returns a Promise that resolves with a boolean (true if local storage is supported, false if not)
Check whether a file exists in Local Storage at a given path.
A valid key corresponding to a saved diagram file in Local Storage
Returns a Promise that resolves with a boolean stating whether a file exists in LocalStorage at a given path
Get information about a diagram file saved to Local Storage. This data includes:
Note: Id, name, and path are all provided (despite being the same). They are required for creating valid DiagramFiles.
A valid key corresponding to a saved diagram file in Local Storage
Returns a Promise that resolves with information about a diagram file saved to local storage
Get the contents of a given file; load to managedDiagrams model.
A valid localstorage key to load diagram model data from
Returns a Promise that resolves with a DiagramFile representing the loaded file
Get the contents of a given file; load to managedDiagrams model. Use the custom filepicker ui.
Returns a Promise that resolves with a DiagramFile representing the loaded file
Delete a given diagram from Local Storage.
A valid localstorage key to delete diagram model data from
Returns a Promise that resolves with a DiagramFile representing the deleted file
Delete a diagram from Local Storage using the custom filepicker menu ui.
Returns a Promise that resolves with a DiagramFile representing the deleted file
Save managedDiagrams' model data to Local Storage. If path is supplied save to that path. If no path is supplied but currentDiagramFile has non-null, valid properties, update saved diagram file content at the key in Local Storage corresponding to currentDiagramFile.path with current managedDiagrams' model data. If no path is supplied and currentDiagramFile is null or has null properties, this calls saveWithUI.
A string to save diagram model data to (becomes the key for the file in Local Storage)
Returns a Promise that resolves with a DiagramFile representing the saved file
Save the current managedDiagrams's model data to Local Storage using the custom filepicker ui.
Returns a Promise that resolves with a DiagramFile representing the saved file
Show the custom Go Local Storage filepicker ui.
Clarify what action is being done after file selection. Must be one of the following:
Optional: Number of files to show in UI, in addition to a static numerical property (that can only be modified by changing source code). This prevents long wait times while the UI loads if there are a large number of diagram files stored in Local Storage.
Returns a Promise that resolves (in save, load, or remove with an DiagramFile representing the saved/loaded/deleted file
Class for saving / loading GoJS Models to / from Local Storage. GoLocalStorage is the only GoCloudStorage subclass than can be used in a local page; that is, one not served by a web server.
Note: This class will not work with browsers that do not have Local Storage support (like some old versions of Internet Explorer).