Blockstrap Functions

Blockstrap Functions & Variables

These functions are not attached to any modules and are in most cases used prior to the initialization of the core functions.

They are often called by first setting $bs = blockstrap_functions; - where you can then use the following functions anywhere:


$bs.array_length(obj) - back to top

This function takes and array or an object and returns the number of first-level items it contains.

- back to top


$bs.check(options, callback) - back to top

This function is called prior the Plugin Construct and is designed to ensure that the current device has the minimum requirements. The options are those obtained from defaults.json but is currently not used. In fact, at the moment, the only check that is performed by this function is to ensure that localStorage is functioning normally.

- back to top


$bs.exists(attributes) - back to top

This function checks to see whether the url exists or not.

- back to top


$bs.get_css(attributes) - back to top

This function emulates jQuery.getScript() but is used for including CSS files. It is based upon Intesso's getCSS.

- back to top


$bs.include(blockstrap, start, files, callback, dependency) - back to top

This function is used to include multiple files and then perform the necessary callback function upon completion.

- back to top


$bs.initialize() - back to top

This function is used to initiate core upon first completing the necessary prerequisites.

- back to top


$bs.js(id, src, callback) - back to top

This function is used to add a JavaScript file to the header of the DOM.

- back to top


$bs.json(string) - back to top

This function is check whether or not a string is a JSON array.

- back to top


$bs.slug(slug) - back to top

This function is used to convert a string into something more sensible for URL structures.

- back to top


$bs.unslug(slug) - back to top

This function is used in an attempt to convert a slug back to a more sensible text string.

- back to top


$bs.update(version, callback) - back to top

This function is used to check the version numbers in confguration against those stored locally to determine if an update is required.

- back to top


$bs.vars(variable) - back to top

This function is used for two things. If no variable is provided it will return the variables in the current window.location as an array of objects. If a variable is provided it will return the value of that variable should it exist within the current window.location else it will return false.

- back to top


  1. Related Articles
  2. Return to Core
  3. Configuration Settings
  4. Defaults
  5. Core Functions
  6. Blockstrap Functions
  7. Plugin Construct
  8. Table of Contents