Package

org.querki

jquery

Permalink

package jquery

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. jquery
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. type AttrVal = |[|[String, Int], Boolean]

    Permalink

    This union type represents valid types that you can set an attribute to.

  2. type ElementDesc = |[|[|[String, Element], JQuery], Array[Element]]

    Permalink

    This union type gets used for several functions that really allow anything that can describe an Element.

    This union type gets used for several functions that really allow anything that can describe an Element. This is similar to Selector, but allows you to pass in a JQuery as well.

  3. type JQEvt = JQueryEventObject

    Permalink

    A shorter alias for JQuery events, just to reduce keystrokes.

  4. trait JQuery extends Object

    Permalink

    A facade for the main jQuery object.

    A facade for the main jQuery object.

    This is a reimplementation, very loosely based on the existing scalajs-jquery. It aims to be much more strongly and precisely typed, while being as literal a translation of the functionality of jQuery as possible. It is intentionally pretty close to scalajs-jquery, and many files can be switched over by simply switching the import, but compatibility has *not* been a priority, and a modest number of functions have changed in breaking ways. (This is one reason why I treated this as a rewrite rather than as an evolution of the existing library.)

    TODO: as of this writing, this is *quite* incomplete; I am only adding functions as I use them, and at least half of them are currently missing. Pull requests are greatly welcomed. In particular, we are lacking many overloads -- I've added some of them, but many jQuery functions have a considerable number of potential overloads.

    Many parameters are polymorphic. We use \/ (type union) to define these. Note that there are several common unions such as Selector defined in package.scala.

    NOTE: discussion on scalajs Gitter, 1/28/15, says that facades should *return* Any, but *take* js.Any *if* the Javascript is going to process the value in any way. This is the guiding principle here.

    Also: when a facade function takes a property bag, if it is understood to be name/value pairs in JS, declare it as js.Dictionary[T]. Often, we can constrain T; if not, just put js.Any, and it is at least explicit that it is name/value pairs.

    Annotations
    @RawJSType() @native()
  5. trait JQueryAjaxSettings extends Object

    Permalink
    Annotations
    @RawJSType() @native()
  6. class JQueryAjaxSettingsBuilder extends JSOptionBuilder[JQueryAjaxSettings, JQueryAjaxSettingsBuilder]

    Permalink
  7. trait JQueryDeferred extends Object with JQueryPromise

    Permalink
    Annotations
    @RawJSType() @native()
  8. trait JQueryEventObject extends Event

    Permalink

    The facade over an event from JQuery.

    The facade over an event from JQuery.

    Annotations
    @RawJSType() @native()
  9. class JQueryEventObjectBuilder extends JSOptionBuilder[JQueryEventObject, JQueryEventObjectBuilder]

    Permalink
  10. class JQueryExtensions extends AnyRef

    Permalink

    These are extensions to jQuery -- useful higher-level functions, which mostly tighten up the types.

    These are extensions to jQuery -- useful higher-level functions, which mostly tighten up the types.

    Basically, when you want to express a common idiom, especially one that is particularly helpful in the Scala environment, it belongs here. But this isn't for complex high-level logic, just for stuff that makes JQuery easier to use in Scala.

    Within those constraints, pull requests are welcome for additional utility functions that seem to be at the same level.

  11. trait JQueryPosition extends Object

    Permalink

    Returned by offset() and position().

    Returned by offset() and position().

    Note that the values in here are intentionally not Integers. From the JQuery docs:

    "The number returned by dimensions-related APIs, including .offset(), may be fractional in some cases. Code should not assume it is an integer. Also, dimensions may be incorrect when the page is zoomed by the user; browsers do not expose an API to detect this condition."

    Annotations
    @RawJSType() @native()
  12. trait JQueryPromise extends Object

    Permalink
    Annotations
    @RawJSType() @native()
  13. trait JQueryXHR extends XMLHttpRequest with JQueryDeferred

    Permalink
    Annotations
    @RawJSType() @native()
  14. type Selector = |[|[String, Element], Array[Element]]

    Permalink

    This is a particularly important union type.

    This is a particularly important union type. Selector is a common parameter type in jQuery, meaning essentially a filter for choosing some elements. It can be a string describing a kind of node (using a CSS-ish syntax), an Element, or an Array of Elements.

    Note that the jQuery API documentation is *extremely* inconsistent about how it treats the term "Selector" -- sometimes it just uses the term to mean Strings, sometimes it means all of the possible types. So use this with some care.

Value Members

  1. val $: JQueryStatic.type

    Permalink

    The main entry point into jQuery.

    The main entry point into jQuery. We alias it to $, to match jQuery idiom.

  2. object JQueryAjaxSettings extends JQueryAjaxSettingsBuilder

    Permalink
  3. object JQueryEventObject extends JQueryEventObjectBuilder

    Permalink

    Constructor facade for JQueryEventObject.

    Constructor facade for JQueryEventObject. See the documentation of the JQueryEventObject trait for more information about the various constructor methods.

    TBD: does this need to use jsext? Possibly not. Look at this more closely, and see if switching to a more straightforward constructor is more appropriate in this case. If all of the parameters are singly-typed, then jsext is overkill.

    In general, this is rather half-baked, and needs enhancement and sanity-checking.

  4. object JQueryStatic extends Object

    Permalink
    Annotations
    @native() @JSName( "jQuery" )
  5. implicit def builder2DialogOptions(builder: JQueryEventObjectBuilder): JQueryEventObject

    Permalink
  6. implicit def jQuery2Ext(jq: JQuery): JQueryExtensions

    Permalink
  7. implicit def seq2ElementDesc(seq: Seq[Element]): ElementDesc

    Permalink
  8. implicit def seq2Selector(seq: Seq[Element]): Selector

    Permalink

    Convenience conversion, so that you can use a Scala Seq[Element] where the API expects a js.Array[Element].

Inherited from AnyRef

Inherited from Any

Ungrouped