org.querki

jquery

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
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. type AttrVal = Either[tor[String, Int], Boolean]

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

  2. type ElementDesc = Either[tor[tor[tor[String, Element], JQuery], Array[Element]], Seq[Element]]

    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

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

  4. trait JQuery extends Object

    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 are currently dealing with the messy cases by defining a polymorphic type in package.scala, using the "tor" type-union trick, and then defining a mid-level facade for that method in JQueryTyped. Then we put a primitive "Internal" version of the method in here. As a rule, you should not directly use any methods here named [something]Internal -- they should always have a more precisely-typed version in JQueryTyped.

    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.

    TODO: we should probably mark the XXXInternal methods as private [jquery]. See if that works.

    Annotations
    @RawJSType()
  5. trait JQueryAjaxSettings extends Object

    Annotations
    @RawJSType()
  6. trait JQueryDeferred extends Object with JQueryPromise

    Annotations
    @RawJSType()
  7. trait JQueryEventObject extends Event

    The facade over an event from JQuery.

    The facade over an event from JQuery.

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

  9. class JQueryExtensions extends AnyRef

    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.

  10. trait JQueryPosition extends Object

    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()
  11. trait JQueryPromise extends Object

    Annotations
    @RawJSType()
  12. class JQueryTyped extends AnyRef

    These are strongly-typed signatures for polymorphic JQuery classes.

    These are strongly-typed signatures for polymorphic JQuery classes. They each call internal classes in the underlying JQuery facade which are loosely-typed.

    You should basically consider this class to be complementary to JQuery, and you should pretty much always import it when trying to work with JQuery objects. It is implicitly converted from JQuery, and provides the strongly-typed facade over the weakly-typed internal facades in that.

  13. trait JQueryXHR extends XMLHttpRequest with JQueryDeferred

    Annotations
    @RawJSType()
  14. type Selector = Either[tor[tor[String, Element], Array[Element]], Seq[Element]]

    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.

  15. type tor[A, B] = Either[A, B]

Value Members

  1. val $: JQueryStatic.type

    The main entry point into jQuery.

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

  2. object JQueryEventObject extends JQueryEventObjectBuilder

    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.

  3. object JQueryStatic extends Object

    Annotations
    @JSName( "jQuery" )
  4. implicit def builder2DialogOptions(builder: JQueryEventObjectBuilder): JQueryEventObject

  5. implicit def jQuery2Ext(jq: JQuery): JQueryExtensions

  6. implicit def jQuery2Typed(jq: JQuery): JQueryTyped

  7. implicit def l[T](t: T): Left[T, Nothing]

  8. implicit def ll[T](t: T): Left[Left[T, Nothing], Nothing]

  9. implicit def lll[T](t: T): Left[Left[Left[T, Nothing], Nothing], Nothing]

  10. implicit def llll[T](t: T): Left[Left[Left[Left[T, Nothing], Nothing], Nothing], Nothing]

  11. implicit def lllr[T](t: T): Left[Left[Left[Right[Nothing, T], Nothing], Nothing], Nothing]

  12. implicit def llr[T](t: T): Left[Left[Right[Nothing, T], Nothing], Nothing]

  13. implicit def lr[T](t: T): Left[Right[Nothing, T], Nothing]

  14. implicit def r[T](t: T): Right[Nothing, T]

  15. def toJsAny[A, B, T](v: T)(implicit arg0: (T) ⇒ tor[A, B]): Any

    Given a parameter of a "tor"ed type, extract the actual value and cast it to js.Any.

    Given a parameter of a "tor"ed type, extract the actual value and cast it to js.Any. You use this in a strongly-typed mid-level facade, and pass the result into a weakly-typed low-level facade.

    Note that this automatically turns a Seq[_] into a js.Array, to make it a bit easier to write idiomatic Scala code for signatures that take js.Array.

Inherited from AnyRef

Inherited from Any

Ungrouped