YouOS Javascript APIs
When developing apps within YouOS, you have a wide variety of methods and APIs you can call. Here is the growing list.
Notes:
- All YouOS javascript methods are in the namespace "uos", and there are numerous sub-namespaces, e.g. "uos.data", "uos.ui", etc.
- Many methods take an optional "options" object that can modify the behavior of the method
- Many methods take callback functions as parameters - functions that are called with specific parameters when the API completes.
- Some API packages are automatically included in YouOS, while others must be loaded by apps via the app_deps property.
Contents:
- uos.api: Generic API utility packages, as well as many APIs themselves (online file system, etc.)
- uos.control: Contains MVC controller objects.
- uos.crosstalk: Packages that connect components within same application process
- uos.data: Packages to manipulate server-side data structures.
- uos.message: For sending event messages to users
- uos.model: Contains MVC model object representing lists, trees, etc.
- uos.system: Packages for OS methods like open/close apps.
- uos.ui: Helper packages for manipulating UI widgets and elements.
- uos.util: Miscellaneous helper packages
- other: Other packages
uos.api
Generic API utilities, as well as many APIs themselves.
Always available:
- uos.api - general utilities to call server APIs and handle their results
Must be included as dynamic library:
- uos.api.apps - get applications available for execution
- uos.api.fs - youfs online file system
- uos.api.login - methods to log user in and out
- uos.api.rss - get RSS and Atom feeds from the web
- uos.api.tags - methods to tag datastructures
- uos.api.translation - translate text between languages
- uos.api.url - get html, xml, and binary resources from the web
- uos.api.user - methods to read and manipulate user profiles
uos.control
Contains MVC controller objects which bind models to views. All controller methods must be dynamically included. This particular package is subject to revision.
- uos.control.ListController - controller which synchronizes a list model and a view
- uos.control.LabelTreeController - controller which applies labels to a tree view (subject to change)
- uos.control.SelectController - View and controller for an HTML select object.
uos.crosstalk
Methods to easily connect components within the same process. All modules must be dynamically included.
- uos.crosstalk - Methods and message classes for the Crosstalk system.
- uos.crosstalk.Connector? - An object which connects components within a process through events.
uos.data
Manipulate server-side data structures.
Always available:
- uos.data - static methods for manipulating data structures
- uos.data.DataStructure - abstract super class which other persistent data structures extend
- uos.data.Hashtable - persistent hashtable for putting and getting key value pair items
- uos.data.Socket - persistent socket for reading and writing messages
- uos.data.Queue - persistent queue for putting and getting messages
Must be included as dynamic library:
- uos.data.Textfile - persistent textfile for storing large strings
uos.message
- uos.message - For sending dojo event based messages to users.
uos.model
Contains MVC model object representing lists, trees, etc. All modules must be dynamically included.
- uos.model.models - Utility methods to get common models and comparators
- uos.model.ListModel - A model that represents a list
- uos.model.Node - A node in a model
- uos.model.TreeModel - A model that represents a tree
uos.system
OS level APIs like open/close applications and processes.
- uos.system - general system utilities
- uos.system.buddy - manage a user's buddy list
uos.ui
Manipulate UI widgets and elements.
- uos.ui - Utility UI methods.
The following components are loaded when YouOS loads:
- uos.ui.Component - component superclass
- uos.ui.Button - button component
- uos.ui.Container - container component (may be refactored)
- uos.ui.Layout - layout superclass
- uos.ui.MenuItem - menu item component
- uos.ui.Menu - menu component
- uos.ui.MenuSeparator - menu separator component
- uos.ui.PopupMenu - popup menu component
- uos.ui.Desktop - desktop object
- uos.ui.Taskbar - taskbar object
- uos.ui.constant - literal constants used by UI components
The following widget and window-related classes are also loaded when YouOS loads:
- uos.ui.widget.Widget - root Widget class
- uos.ui.widget.Window - Window class, extends Widget
The following components are loaded dynamically:
- uos.ui.ChannelBox - public chat box component
- uos.ui.ChatBox - chat box component
- uos.ui.ChatTextField - chat text field component
- uos.ui.CheckLabel - label with selected/unselected value
- uos.ui.Curtain - dimmer switch for entire desktop
- uos.ui.Dialog - superclass for in-window dialogs
- uos.ui.FileBrowser - full component for browsing, sharing, opening, deleting and tagging files
- uos.ui.FileList - shows a list of files
- uos.ui.HGridLayout - makes a resizable layout that is an n x 1 table (FF 1.0 known issue)
- uos.ui.HorizontalLayout - like a FlowLayout in Java; organizes components L to R or R to L (FF 1.0 known issue)
- uos.ui.IBrowser - a component which contains an IFrame and has navigation methods
- uos.ui.Label - a component with icon and text, to label things
- uos.ui.ListView - a component which lists elements
- uos.ui.ModalDialog - a dialog with curtain shown in front of the entire screen
- uos.ui.ModeLabel - a label with mode; image changes based on current mode
- uos.ui.StretchLayout - a layout that changes inner component size to fill the space
- uos.ui.TagList - a component which shows the list of tags a user has created
- uos.ui.TextField - a component that allows for inputting text
- uos.ui.TreeNode - a visual component corresponding to a node in a TreeView.
- uos.ui.TreeView - a tree component
- uos.ui.Viewport -a component that creates scrollbars, if necessary, around another surrounded component (FF 1.0 known issue)
The following dialog classes are loaded dynamically:
- uos.ui.dialogs.ChannelDialog - a dialog that shows a chat at a particular channel.
- uos.ui.dialogs.MessageDialog - a dialog that shows a simple message.
- uos.ui.dialogs.ShareDialog - a dialog that allows you to share a particular data structure with other users
- uos.ui.dialogs.TagDialog - a dialog that allows you to enter tags for a particular data structure
- uos.ui.dialogs.TextEntryDialog - a dialog that prompts you to enter a value.
The following renderer classes (for views, based on models) are loaded dynamically:
- uos.ui.renderers.CheckLabelRenderer - Creates CheckLabels from Nodes, assigns checked value
- uos.ui.renderers.ModeLabelRenderer - Creates ModeLabels from Nodes, assigns mode value
- uos.ui.renderers.PlainLabelRenderer - Creates plain Label objects from Nodes
uos.util
Miscellaneous utilities
Always available:
- uos.util.array - Methods for working with arrays
- uos.util.dom - Methods for working with the Document Object Model of a page
- uos.util.html - Methods for escaping html
- uos.util.obj - Methods for getting information about and converting from javascript objects
- uos.util.pool - Methods for working with pools of server generated id sequences
- uos.util.seq - Methods for creating a client-side incrementing sequence
- uos.util.sort - Methods for sorting javascript objects
- uos.util.string - Methods for string conversion and interpolation
- uos.util.word - Methods for spell checking
Must be included dynamically:
- uos.util.base64 - Methods for encoding and decoding in base64
- uos.util.poplist - Methods for working with html SELECT objects
- uos.util.time - Methods for converting time to string
Other
Always available:
- uos.assert - programmatic assertion handling
- uos.browser - find out which browser a user is using
- uos.constant - a list of javascript constants used throughout YouOS
- uos.debug - application debugging helper methods
- uos.lang - a set of javascript language helpers
- uos.uri - manage URLs to APIs
Must be included as dynamic library:
- uos.bigint - contains methods to handle very large integers; experimental
