Global Bright object core functions

Accessible via global variable br

br.startProgress(total, title) Twitter BootstrapExternal dependency
  • total - total progres bar steps
  • title - optional progress bar title

This function will show progress bar

Run example Script sources

br.stepProgress(title) Twitter BootstrapExternal dependency
  • title - optional progress bar title

This function will step progress by 1

br.hideProgress() Twitter BootstrapExternal dependency

This function will hide progress bar

br.log(vars)

Log varibles to the debug console

br.inform(title, message, callback) Twitter BootstrapExternal dependency
  • title - information popup title
  • message - information popup message
  • callback - optional callback, will be invoked after user close the information popup

This function will show information popup

Run example Script sources

br.error(title, message, callback) Twitter BootstrapExternal dependency
  • title - information popup title
  • message - information popup message
  • callback - optional callback, will be invoked after user close the information popup

This function will show error popup

Run example Script sources

br.confirm(title, message, buttons, callback, params) Twitter BootstrapExternal dependency
  • title - confirmation popup title
  • message - confirmation popup message
  • buttons - optional buttons array
  • callback - callback, will be invoked if user confirm the question
  • params - additional parameters, the only one accepted at this point is showDontAskMeAgain - true/false. This option will add "Don't ask me again" checkbox.

This function will show confirmation popup

Run example 1 Run example 2 Run example 3 Script sources

br.prompt(title, fields, callback, params) Twitter BootstrapExternal dependency
  • title - information popup title
  • fields - fields with default values
  • callback - callback, will be invoked after user close the prompt popup. Array of values will be passed as parameter.

This function will show prompt popup

Run example Script sources

br.growlError(message, image) gritter or humaneExternal dependency
  • message - Message
  • image - Image :)

This function will growl error message

Run example Script sources

br.growlMessage(message, image) gritter or humaneExternal dependency
  • message - Message
  • image - Image :)

This function will growl message

Run example Script sources

br.fetch(template, data, tags) br.baseUrl br.isTouchScreen()

Return true if current device has touch screen

br.isiOS()

Return true if current device is iOS device

br.isAndroid()

Return true if current device is Android device

br.redirect(url)

This will redirect user to the specified url

br.refresh()

This will refresh current page

br.preloadImages() br.randomInt() br.forHtml() br.extend() br.toInt() br.openPopup() br.modifiedDeferred() br.modified() br.confirmClose() br.resetCloseConfirmation() br.load.js() br.load.css() br.isNumber(val)