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 EventHandler = |[|[|[Function0[Any], Function1[JQueryEventObject, Any]], ThisFunction0[Element, Any]], ThisFunction1[Element, JQueryEventObject, Any]]

    Permalink

    This union type covers the possible signatures of functions to pass into event-registration functions like "click" or "hover".

  4. type JQEvt = JQueryEventObject

    Permalink

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

  5. 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 often use | (type union) to define these, but | and UndefOr don't mix, so we often have to spell things out in more detail. Also, you can't use a js.Function or js.ThisFunction in a | expression, because it interferes with the compiler's implicit conversion from a Scala function to a js.Function. Note that there are several common unions such as Selector defined in package.scala.

    Things are also often spelled out more explicitly than you might expect, because Scala restricts us to one overload per method with default parameters; this limits our usage of UndefOr.

    We don't necessarily spell out every possible overload here, although we've made a serious effort to make every version of the JS calls possible. In some cases, we only have versions that involve some extra parameters. If you find yourself really wanting an overload that takes fewer parameters, pull requests are welcome.

    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.

    Long-deprecated functions are, by and large, simply omitted. Please see the jQuery documentation to see what to use instead.

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

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

    Permalink
  8. trait JQueryAnimationSettings extends Object

    Permalink
    Annotations
    @RawJSType() @native()
  9. class JQueryAnimationSettingsBuilder extends JSOptionBuilder[JQueryAnimationSettings, JQueryAnimationSettingsBuilder]

    Permalink
  10. trait JQueryCallbacks extends Object

    Permalink
    Annotations
    @RawJSType() @native()
  11. trait JQueryDeferred extends Object with JQueryPromise

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

    Permalink

    The facade over an event from JQuery.

    The facade over an event from JQuery.

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

    Permalink
  14. 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.

  15. trait JQueryFN extends Object

    Permalink
    Annotations
    @RawJSType() @native()
  16. trait JQueryFX extends Object

    Permalink
    Annotations
    @RawJSType() @native()
  17. 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() @ScalaJSDefined()
  18. trait JQueryPromise extends Object

    Permalink
    Annotations
    @RawJSType() @native()
  19. trait JQuerySerializeArrayElement extends Object

    Permalink

    Returned by serializeArray().

    Returned by serializeArray().

    Annotations
    @RawJSType() @native()
  20. trait JQueryTransport extends Object

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

    Permalink
    Annotations
    @RawJSType() @native()
  22. type Number = |[Double, Int]

    Permalink
  23. 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 JQueryAnimationSettings extends JQueryAnimationSettingsBuilder

    Permalink
  4. 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.

  5. object JQueryStatic extends Object

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

    Permalink
  7. implicit def f02EventHandler(func: () ⇒ Any): EventHandler

    Permalink
  8. implicit def f12EventHandler(func: (JQueryEventObject) ⇒ Any): EventHandler

    Permalink
  9. implicit def ft02EventHandler(func: (Element) ⇒ Any): EventHandler

    Permalink
  10. implicit def ft12EventHandler(func: (Element, JQueryEventObject) ⇒ Any): EventHandler

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

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

    Permalink
  13. 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