Show:

Streams preview Class

Provides base protocol and behavior for rendering a stream preview. Should be combined with a tool on the same element that will actually manage and render the interface.

Constructor

Streams preview

(
  • [options]
  • [options.creatable.title="New
)

Parameters:

  • [options] Object optional

    this object contains function parameters

    • publisherId String

      The publisher's user id.

    • [streamName] String optional

      If empty, and "creatable" is true, then this can be used to add new related streams.

    • [related] Object optional

      , Optional information to add a relation from the newly created stream to another one. Usually set by a "Streams/related" tool. Can include:

      • [publisherId] String optional
        the id of whoever is publishing the related stream
      • [streamName] String optional
        the name of the related stream
      • [type] Mixed optional
        the type of the relation
      • [weight] Number optional
        to override the weight of the relation
    • [editable=true] Boolean | Array optional

      Set to false to avoid showing even authorized users an interface to replace the image or text. Or set to an array naming only certain fields, which the rendering method would hopefully recognize.

    • [closeable=true] Boolean optional

      Set to false to avoid showing even authorized users an option to closeable (or close) this stream

    • [creatable] Object optional

      Optional fields you can override in case if streamName = "",

      • [streamType="Streams/text/small"] String optional
        Set the type of the stream to be created
      • [clickable=true] Boolean optional
        Whether the image composer image is clickable
      • [addIconSize=100] Number optional
        The size in pixels of the square add icon
      • [options={}] Number optional
        Any options to pass to Q.Streams.create
      • [preprocess] Function optional
        This function receives (a callback, this tool, the event if any that triggered it). This is your chance to do any processing before the request to create the stream is sent. The function must call the callback. If you handled creating the stream yourself, pass the stream name as the first parameter, (and optionally the weight of the relation as the second parameter.) If you canceled the process, pass false instead as the first parameter. However, if you want to go ahead and let the preview tool call Q.Streams.create, you can pass here a plain Object with any fields to set for the stream, such as "title", "content", "attributes" (as JSON string), "name", etc.
    • [imagepicker] Object optional

      Any options to pass to the Q/imagepicker jquery plugin -- see its options.

    • [actions] Object optional

      Any options to pass to the Q/actions jquery plugin -- see its options.

    • [sizes] Object optional

      If passed, uses this instead of Q.Streams.image.sizes for the sizes

    • [overrideShowSize] Object optional

      A hash of {icon: size} pairs to override imagepicker.showSize when the icon is a certain string. The empty string matches all icons.

    • [throbber="{{Q}}/img/throbbers/loading.gif"] String optional

      The url of an image to use as an activity indicator when the image is loading

    • [cacheBust=null] Number optional

      Number of milliseconds to use for combating the re-use of cached images when they are first loaded.

    • [beforeCreate] Q.Event optional

      An event that occurs right before a composer requests to create a new stream

    • [onCreate] Q.Event optional

      An event that occurs after a new stream is created by a creatable preview

    • [onComposer] Q.Event optional

      An event that occurs after a composer is rendered. Tools that extend Streams/preview can bind this event to a method to override the contents of the composer.

    • [onRefresh] Q.Event optional

      An event that occurs after a stream preview is rendered for an existing stream. Tools that extend Streams/preview can bind this event to a method to override the contents of the tool.

    • [onLoad] Q.Event optional

      An event that occurs after the refresh calls its callback, which should happen when everything has fully rendered

    • [beforeClose] Q.Event optional

      Optionally set to a function that takes a callback, to display e.g. a dialog box confirming whether to close the stream. It should call the callback with no arguments, in order to proceed with the closing.

    • [onClose] Q.Event optional

      An event that occurs after a stream with a preview has been closed

    • [templates] Object optional

      Under the keys "views", "edit" and "create" you can override options for Q.Template.render . The fields passed to the template include "alt", "titleTag" and "titleClass"

      • [create] Object optional
      • [create.name] String optional
      • [create.fields] Object optional
      • [create.fields.alt] String optional
      • [create.fields.titleClass] String optional
      • [create.fields.titleTag] String optional
  • [options.creatable.title="New String

    Item"] Optional title for the case when streamName = "", i.e. the composer

Item Index

Methods

hautoscroll

(
  • [options]
)

Plugin for Animated moving Element content inside it from let to right

Parameters:

  • [options] Object optional

    options object containing parameters for function

    • [scrollTime] Number optional

      scrollTime number of interval for content right movement in milliseconds

    • [pauseBefore] Number optional

      pauseBefore is a number for interval before animation starts in milliseconds

    • [pauseAfter] Number optional

      pauseAfter number of interval for content left movement to margin-left: 0 in milliseconds

icon

(
  • element
  • onLoad
  • [options]
)

Parameters:

iScroll

(
  • [object_or_string]
)

Just a helper for iScroll plugin. Needed to simplify applying iScroll and Q/scrollIndicators plugins.

Parameters:

  • [object_or_string] Mixed optional
    • [Object] Object optional

      an Object, then it's a hash of options, similar to these passed to iScroll plus additional parameters: "indicators": Defaults to true. Whether to show scroll indicators (apply Q/scrollIndicators plugin).

      • [x] Number optional
        x
      • [y] Number optional
        y
      • [hScrollbar] Boolean optional
        hScrollbar
      • [vScrollbar] Boolean optional
        vScrollbar
      • [hScroll] Boolean optional
        hScroll
      • [hideScrollbar] Boolean optional
        hideScrollbar
      • [fadeScrollbar] Boolean optional
        fadeScrollbar
      • [useTransition] Boolean optional
        useTransition
      • [topOffset] Number optional
        topOffset
      • [onRefresh] Q.Event optional
        onRefresh
      • [onBeforeScrollStart] Q.Event optional
        onBeforeScrollStart
      • [onScrollStart] Q.Event optional
        onScrollStart
      • [onScrollMove] Q.Event optional
        onScrollMove
      • [onScrollEnd] Q.Event optional
        onScrollEnd
      • [onTouchEnd] Q.Event optional
        onTouchEnd
      • [showArrows] Boolean optional
        showArrows
      • [horizontalGutter] Number optional
        horizontalGutter
      • [verticalGutter] Number optional
        verticalGutter
      • [maintainPosition] Boolean optional
        maintainPosition
      • [autoReinitialize] Boolean optional
        autoReinitialize
      • [animateScroll] Boolean optional
        animateScroll
      • [hijackInternalLinks] Boolean optional
        hijackInternalLinks
      • [indicators] Boolean optional
        indicators
    • [String] String optional

      If a string, then it's a command which may be: "remove": Destroys iScroll together with Q/scrollIndicators.

pick

()

Set the image in the imagepicker

remove

()

Removes the imagepicker functionality from the element