Collection of common Assets, Javascript and CSS files to be used by my GBF Asset Lookup and GBF Animation Player projects to build their HTML pages.
It's intended to be in a folder alongside the other projects:
Root Folder/
├── GBFAL/
├── GBFML/
└── GBFAP/
All lists further below are non-exhaustive.
The main CSS file, used for the GBF Asset Lookup main page.
Requires util.js
.
Contains a class to handle types and corresponding index keys, along with returning endpoints for assets.
Intended to be instantiated once in a global gbf
variable upon initialization.
Requires gbf.js
and util.js
.
Used to build GBF Asset Lookup and GBF Animation Player pages, such as building the indexes or listing elements.
Expect an index
global variable to exist following the GBF Asset Lookup format.
GBF Animation Player overrides some functions to bypass the format differences.
List of callbacks:
get_special_navigation_indexes(element_id, index_category_target, index_of_current_element_in_list, list_of_elements)
: Used for special "previous/next" navigation buttons, if you wish to "skip" along some elements in the list.index_onclick
: The onclick callback for elements generated bylist_elements
.bookmark_onclick
: The onclick callback for elements generated bylist_elements
for the bookmark list.history_onclick
: The onclick callback for elements generated bylist_elements
for the history list.
Requires page.js
and util.js
(if a result area to populate is passed).
Contains a class to generate search results.
Intended to be instantiated once in a global search
variable upon initialization.
Expect an GBF Asset Lookup or GBF Animation Player index
variable to exist with the lookup
key to be set, containing an object of ID and lookup string pairs.
List of callbacks:
index_onclick
: The onclick callback for elements generated bylist_elements
for the populated result area.lookup(element_id)
: The function to call ifallow_lookup
is set.
Standalone.
Contains utility functions.
config.json
must be loaded and passed to some functions at the start to initialize the index or set specific settings.
Here's a list of some of them:
help_form
(Optional String), url to the Google Form.index
(Object), the index layout.
Some variables might require to be defined to be used for some features:
timestamp
(Integer), forclock()
.index
(Object), ideally in the GBF Asset Lookup format, for most of the project.updated_key
(String), the localStorage key to handle the glow on the "tab-new" button.bookmark_key
(String), the localStorage key to save the bookmarks.history_key
(String), the localStorage key to save the history.search_save_key
(String), the localStorage key to save the search settings.