Skip to content

MizaGBF/GBFML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GBF Miza's Library

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.

Style Files

style.css

The main CSS file, used for the GBF Asset Lookup main page.

Javascript Files

gbf.js

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.

page.js

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 by list_elements.
  • bookmark_onclick: The onclick callback for elements generated by list_elements for the bookmark list.
  • history_onclick: The onclick callback for elements generated by list_elements for the history list.

search.js

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 by list_elements for the populated result area.
  • lookup(element_id): The function to call if allow_lookup is set.

util.js

Standalone.
Contains utility functions.

JSON

config.json

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.

Variables

Some variables might require to be defined to be used for some features:

  • timestamp (Integer), for clock().
  • 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.

About

Common files for GBFAL and GBFAP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published