Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Documented custom templates and scripts

...

Returns a hash of all the parameters that are passed into the custom template. The return value of this method is used as input for the customWidgetTemplate call.

customTemplates

widget.customTemplates['myTemplate.html'](parameters)

If any additional (apart from widget.html) HTML templates have been uploaded with the widget, they can be accessed trough this property.

Contains a dictionary with keys being the template file names, and values the preconfigured template functions, which will return the correct HTML string upon execution.

Optional parameters can be passed in and accessed in the template.

customScripts

widget.customScripts['myLibrary.js'](/* no arguments */)

If any additional (apart from widget.js) javascript files have been uploaded with the widget, they can be accessed trough this property.

Contains a dictionary with keys being the script file names, and values inline functions which, when called, will return the Promise resolving when the asynchronous loading of the script finishes.

Code Block
languagejs
widget.customScripts['myLibrary.js']().then(libraryResolvedFunction);

renderContent()

widget.renderContent(/* no arguments */)

...