Skip to content

Eden Functions

Nick Pope edited this page Dec 12, 2015 · 15 revisions

A library of useful functions is provided for Eden, many of which have been ported over from the older tkeden tool. However, not all functions in tkeden are available here (yet) and there are many which are specific to this javascript implementation. This page documents all core functions, some plugins such as Canvas provide many more functions and these are documented on the relevant plugin wiki page.

lib

lib/core

lib/math

lib/clock

lib/list

lib/type

lib/string

lib/dynamic

lib/functional

abs(number)

  • number - Any floating point or integer value

Returns the absolute value of the number, removing any negative sign.

acos(number)

asin(number)

atan(number)

ceil(number)

  • number - Any floating point value

Returns the number rounded up to the nearest integer.

cos(number)

  • number - Any floating point angle in degrees

Returns the cosine of the number.

createView(name,type)

  • name - A string name to give the view
  • type - Type of view to create.

Constructs a dialog view of the specified type. The types of views available can be found in the menu bar and depends upon what plugins have been loaded.

exp(number)

  • number - Any floating point or integer value

Returns e to the power of number.

execute(script)

  • script - A string of Eden script.

Parses and executes the string as an Eden script.

floor(number)

  • number - Any floating point value

Returns the number rounded down to the nearest integer.

forget(observable)

  • observable - String of observable name.

Deletes the specified observable from the symbol table.

hideView(name)

  • name - Name of the view dialog.

Hides the named view dialog. Can be shown again either using showView or using the menu bar.

html([name], html)

  • [name] - Optional name of html view dialog, if more than one exists.
  • html - A string of HTML code

Requires the HTML view plugin to be loaded. Will update the html content of a html view dialog.

include(file)

  • file - File name of script.

Loads an Eden script file from the server. The file must be on the same server as js-eden. This is a blocking load so will be slow, see includeSSI for a non-blocking and faster loading mechanism.

include_css(file)

  • file - File name of CSS code.

Loads CSS into the current session. The CSS file can be any URL, it is not restricted to the local server.

include_js(file)

  • file - File name of Javascript code.

Loads Javascript into the current session. The JS file can be any URL.

Clone this wiki locally