Page MenuHomeGitPull.it
Diviner All Atoms
    • Javelin strategic command, the master event delegation core. This class is a sort of hybrid between Arbiter and traditional event delegation, and serves to route event information to handlers in a general way.
    • Class
    • @{class:JX.Event} installs a toString() method in ##__DEV__## which allows you to log or print events and get a reasonable representation of them:
    • Method
    • A generic event, routed by @{class:JX.Stratcom}. All events within Javelin are represented by a @{class:JX.Event}, regardless of whether they originate from a native DOM event (like a mouse click) or are custom application events.
    • Class
    • Function
    • Function
    • Creates a class from a map of attributes. Requires ##extend## property to be an actual Class object and not a "String". Supports ##name## property to give the created Class a readable name.
    • Function
    • Install a class into the Javelin ("JX") namespace. The first argument is the name of the class you want to install, and the second is a map of these attributes (all of which are optional):
    • Function
    • Function
    • Print a message to the browser debugging console (like Firebug).
    • Function
    • Identity function; returns the argument unmodified. This is primarily useful as a placeholder for some callback which may transform its argument.
    • Function
    • Convert an object's keys into a list. For example:
    • Function
    • "Bag of holding"; function that does nothing. Primarily, it's used as a placeholder when you want something to be callable but don't want it to actually have an effect.
    • Function
    • Create a function which invokes another function with a bound context and arguments (i.e., partial function application) when called; king of all functions.
    • Function
    • Copy properties from one object to another. If properties already exist, they are overwritten.
    • Function
    • Checks whether a value is an array.
    • Function
    • Cast a value into an array, by wrapping scalars into singletons. If the argument is an array, it is returned unmodified. If it is a scalar, an array with a single element is returned. For example:
    • Function
    • Convert an array-like object (usually ##arguments##) into a real Array. An "array-like object" is something with a ##length## property and numerical keys. The most common use for this is to let you call Array functions on the magical ##arguments## object.
    • Function
    • Throw an exception and attach the caller data in the exception.
    • Function
    • Function
    • Function
    • Get the margin width required to avoid double scrollbars.
    • Method
    • Method
    • Provides an aesthetic scrollbar.
    • Class
    • Loads one or many static resources (JavaScript or CSS) and executes a callback once these resources have finished loading.
    • Method
    • Show a "mask" over the page for lightboxes or dialogs. This is used by Workflow to draw visual attention to modal dialogs.
    • Class
    • Method
    • JSON serializer and parser. This class uses the native JSON parser if it is available; if not, it provides an eval-based parser and a simple serializer.
    • Class
    • Query and update the DOM. Everything here is static, this is essentially a collection of common utility functions.
    • Class
    • Create a new DOM node with attributes and content.
    • Function
    • Build a new HTML object from a trustworthy string. JX.$H is a shortcut for creating new JX.HTML instances.
    • Function
    • Method
    • Method
    • Upcast a string into an HTML object so it is treated as markup instead of plain text. See @{JX.$N} for discussion of Javelin's security model. Every time you call this function you potentially open up a security hole. Avoid its use wherever possible.
    • Class
    • Select an element by its "id" attribute, like ##document.getElementById()##. For example:
    • Function
    • Method
    • Synchronize multiple tabs over LocalStorage.
    • Class
    • On initialization, the browser-dependent viewport root is determined and stored.
    • Method
    • Change a vector's x and y coordinates by adding numbers to them, or adding the coordinates of another vector. For example:
    • Method
    • Method
    • Construct a vector, either from explicit coordinates or from a node or event. You can pass two Numbers to construct an explicit vector:
    • Method
    • Query and update positions and dimensions of nodes (and other things) within within a document. Each vector has two elements, 'x' and 'y', which usually represent width/height ('dimension vector') or left/top ('position vector').
    • Class
    • Convenience function that returns a @{class:JX.Vector} instance. This allows you to concisely write things like:
    • Function
    • Execute previously defined Javelin behaviors, running the glue code they contain to glue stuff together. See @{article:Concepts: Behaviors} for more information on Javelin behaviors.
    • Function
    • Define a Javelin behavior, which holds glue code in a structured way. See @{article:Concepts: Behaviors} for a detailed description of Javelin behaviors.
    • Function
    • Method
    • Method
    • Sink into a hopeless, cold mire of limitless depth from which there is no escape.
    • Class
    • Method
    • Make basic AJAX XMLHTTPRequests.
    • Class
    • Boolean. If true (default), the user is permitted to submit the typeahead with a custom or empty selection. This is a good behavior if the typeahead is attached to something like a search input, where the user might type a freeform query or select from a list of suggestions. However, sometimes you require a specific input (e.g., choosing which user owns something), in which case you can prevent null selections.
    • Method
    • Construct a new Typeahead on some "hardpoint". At a minimum, the hardpoint should be a ##<div>## with "position: relative;" wrapped around a text ##<input>##. The typeahead's dropdown suggestions will be appended to the hardpoint in the DOM. Basically, this is the bare minimum requirement:
    • Method
    • A typeahead is a UI component similar to a text input, except that it suggests some set of results (like friends' names, common searches, or repository paths) as the user types them. Familiar examples of this UI include Google Suggest, the Facebook search box, and OS X's Spotlight feature.
    • Class
    • Optional function which is used to filter results before display. Inputs are the input string and a list of matches. The function should return a list of matches to display. This is the minimum useful implementation:
    • Method
    • Method
    • Method
    • Method
    • Typeahead source that uses static data passed to the constructor. For larger datasets, use @{class:JX.TypeaheadPreloadedSource} or @{class:JX.TypeaheadOnDemandSource} to improve performance.
    • Class
    • Auxiliary data to pass along when sending the query for server results.
    • Method
    • Method