-
Notifications
You must be signed in to change notification settings - Fork 87
API Reference
Dethe Elza edited this page Jan 16, 2015
·
44 revisions
Wiki ▸ API Reference
This is the implementation of Waterbear. It pulls the libraries and the plugins together, implements the IDE and script writing, etc.
- ajax.get() - Loads data from the server using a HTTP GET request.
- ajax.gets() - Loads data from the server using a HTTP GET request and returns the response.
- ajax.post() - Loads data from the server using a HTTP POST request.
- ajax.send() - Perform an asynchronous HTTP (Ajax) request.
- ajax.serialize() - Encodes a set of form elements as a string for submission.
- ajax.submit() - Submits a form using a HTTP POST request and replaces the content of an element with the response.
- ajax.update() - Loads data from the server using a HTTP GET request and replaces the content of the element with the data.
- ajax.x() - Returns a browser-dependent Ajax object.
- wb.Block() - Registers a block and returns a HTML string for the block.
- wb.blockDesc() - Returns the descriptor for the block.
- wb.blockRegistery - An object containing all the registered blocks.
- wb.changeName() - Renames a block.
- wb.cloneBlock() - Makes a copy of the block.
- wb.codeFromBlock() - Returns the code for a specific block.
- wb.getSockets() - Returns an array of all the sockets in a block.
- wb.getSocketValue() - Returns the value in a socket.
- wb.registerSeqNum() - Sets sequence number to a specific value.
- wb.resetSeqNum() - Resets sequence number to 0.
- wb.initializeDragHandlers() - Registers events for dragging blocks.
- Event.off() - Removes an event handler.
- Event.on() - Attaches an event handler function for one or more events to the selected elements.
- Event.once() - Registers an event handler on the event target and removes it immediately after the event is fired.
- Event.trigger() - Executes all handlers and behaviors attached to the matched elements for the given event type.
- wb.createDownloadUrl() - Creates a URL for the current scripts.
- wb.getFiles() - Gets the existing scripts from drag-and-drop event and loads the first scripts.
- wb.loadCurrentScripts() - Loads the scripts from a parsed query object.
- wb.loadRecentGists() - Populates the gist submenu with recent gists.
- wb.loadScriptsFromFilesystem() - Loads the existing scripts from filesystem.
- wb.loadScriptsFromGistId() - Loads the existing scripts from gist.
- wb.saveCurrentScripts() - Saves the current scripts to local storage.
- wb.saveCurrentScriptsToGist() - Saves the current scripts to gist.
- wb.toggleState - A read-only object containing the toggle state of the toggleable items.
- wb.queryParamsToUrl() - Returns an encoded URL string from query parameters.
- wb.urlToQueryParams() - Returns an object containing the query parameters from a URL.
- wb.menu - A HTML element representing the menu.
- wb.populateMenu() - Initializes the menu with the default localization data.
- wb.l10nHalfDone - A boolean value representing whether the system has finished initializing localization data.
- wb.history.add() - Adds an action to the undo stack.
- wb.history.clear() - Clears the undo stack.
- wb.history.redo() - Redoes an action.
- wb.history.undo() - Undoes an action.
- wb.area() - Returns the area of an element.
- wb.closest() - Finds the nearest parent, or self, which matches selector.
- wb.containedBy() - Returns true if the rect of target is at least 90% contained by the rect of container
- wb.dist() - Returns the distance between two points using Pythagorean theorem.
- wb.elem() - Utility for dynamically creating DOM elements and structures.
- wb.find() - Returns the first descendant that matches selector.
- wb.findAll() - Returns a (true) array of all descendants that match selector.
- wb.findChildren() - Finds all direct children which match selector as an array.
- wb.findChild() - Finds the first child which matches selector.
- wb.hide() - Hides an element.
- wb.indexOf() - Returns the index of this element in a list of its parent's children.
- wb.makeArray() - Turns an array-like into a true array.
- wb.matches() - Returns true if the element matches selector.
- wb.overlap() - Returns the area of overlap between two elements.
- wb.overlapRect() - Returns the area of overlap between two rects.
- wb.reposition() - Moves an absolutely positioned element.
- wb.show() - Shows a hidden element.
-
wb.rect() - Utility for calling
elem.getBoundingClientRect(). - wb.resize() - Resizes a text input based on the length of its content.
- isUuid() - Tests if the given value has a UUID format.
- uuid() - Returns a universally unique identifier as a string.
- wb.clearScripts() - Clears the scripts workspace.
- wb.createWorkspace() - Creates a new empty workspace.
- wb.historySwitchState() - Stores the current state and switches to the new state.
- wb.language - A string containing the current localization language code.
- wb.loaded - A boolean value representing whether the script has been loaded.
- wb.wireUpWorkspace() - Sets the workspace to a specific value.