The Indu Standard Library

log

log is a function that takes a string as message and prints it on the JavaScript console of your browser. It's useful for debugging, or otherwise trying to figure out what is going on inside your program.

get-value

get-value will return the DOM value from the browser for an element. It takes a standard CSS selector as selector. It is typically used to find the value of a DOM element corresponding to an Indu element. Use a selector of "#" & @me. # for id, and @me to generate the Indu caddr for the object. The caddr is set as the DOM element id. This is a very low-level function and would typically only be used in the standard library.

get-text

Very like get-value, but it returns the DOM innerText. Use this when the element doesn't have a value, and instead has innerText.

math

An object that contains useful maths functions.

random

Returns random numbers between 0 and a limit you supply as limit. Not cryptographically secure! Use this for fun bits of randomness, not anything serious.

navigator

An object that contains functions to allow Indu programs to move the user around and otherwise control the browser.

move-to

Requests that the Indu program render a different object as the main view. Takes the new object as page.

open-url

Navigates the current tab of the browser to a given URL, takes the url as url.

google-font

A mixin object for an Indu program to load a font from Google Fonts. Takes a list of objects from g-font as fonts. Each g-font object has the family name as family, optionally weights. A single weight can be given as a number. If there are multiple weights, create a list of numbers. In both cases use the attribute weight. 

centered

A mixin object to horizontally center an object in its container. Does this purely with CSS.

text-block

A block of text for your apps. Add one of these to your app, give it an id attribute, and then run the app. The app will allow you to edit the text while it's running, and save the text to be displayed to any users. Only the author of the app can edit the text, everyone else can only read it. Re-use text by giving two (or more) text-blocks the same id. This help text is all written and displayed using a text-block.