API Docs for: 1.0.0
Show:

LADS.Layout.NewCatalog Class

The collections page

Constructor

LADS.Layout.NewCatalog

(
  • options
)
Object

Parameters:

  • options Object

    some options for the collections page

Returns:

Object:

some public methods

Methods

addCollection

(
  • collection
)

Add a collection to the left bar

Parameters:

  • collection Doq

    the collection to add

changeDisplayTag

(
  • artworks
  • tag
)

Changes the selected tag and re-sorts

Parameters:

  • artworks Array

    the array of artwork doqs to sort

  • tag String

    the name of the sort tag

clickCollection

(
  • elt
  • sPos
  • artwrk
)

Click handler for collection title in left bar

Parameters:

  • elt JQuery obj

    the element we're clicking

  • sPos Number

    if undefined, set scroll position to 0, otherwise, use this

  • artwrk Doq

    if undefined, set currentArtwork to null, otherwise, use this

colorSortTags

(
  • tag
)

Set the colors of the sort tags

Parameters:

  • tag String

    the name of the sort tag

contentsHelper

(
  • contents
)

Helper function to process collection contents

Parameters:

  • contents Array

    array of doq objects for each of the contents of this collection

createArtTiles

(
  • artworks
)

Create tiles for each artwork/tour in a collection

Parameters:

  • artworks Array

    an array of doq objects

doSearch

()

Search collection using string in search input box

drawArtworkTile

(
  • currentWork
  • tag
  • onSearch
  • i
  • w
  • h
)

Creates an artwork tile in a collection's catalog

Parameters:

  • currentWork Doq

    the artwork/tour for which we're creating a tile

  • tag String

    current sort tag

  • onSearch Boolean

    whether this work is a match after searching

  • i Number

    index into list of all works in this collection

  • w Number

    width of this tile

  • h Number

    height of this tile

drawCatalog

(
  • artworks
  • tag
  • start
  • onSearch
)

Draw the collection catalog

Parameters:

  • artworks Array

    the contents of the collection

  • tag String

    current sorting tag

  • start Number

    starting at start-th artwork total (note NOT start-th artwork in artworks)

  • onSearch Boolean

    whether the list of artworks is a list of works matching a search term

enableSingleCollectionUI

()

When only a single collection exists, this function modifies the CSS to hide the list of collections and expand the description area.

getCollectionContents

(
  • collecion
  • callback
)

Get contents (artworks, videos, tours) in the specified collection and make catalog

Parameters:

  • collecion Doq

    the collection whose contents we want

  • callback Function

    a function to call when the contents have been retrieved

getCollectionsHelper

()

Helper function to add collections to left bar

getRoot

() JQuery Object

Returns the root of the collections page

Returns:

JQuery Object:

root of the collections page

getState

() Object

Gets the current state of the collections page

Returns:

Object:

object containing state

init

()

Sets up the collections page UI

initSearch

(
  • contents
)

Store the search strings for each artwork/tour

Parameters:

  • contents Array

    the contents of this collection (array of doqs)

loadCollection

(
  • collection
  • isPrivate
)

When a collection is selected in the left bar, load its image and description in the display area

Parameters:

  • collection Doq

    the collection to load

  • isPrivate Boolean

    a little bit of a hack to get private exhibits to show in settings view. When set to true it just ignores anything that relies on 'this' since 'this' doesn't exist for a private exhibit (it doesn't have a label in the exhib list)

showArtwork

(
  • artwork
)

Shows an artwork in the upper section; sets the current thumbnail to be the artwork's and shows name, description, etc

Parameters:

  • artwork Doq

    the artwork doq to be shown

showCollection

(
  • c
)

Show collection contents and display current artwork if there is one

Parameters:

  • c Doq

    the relevant collection doq

sortCatalog

(
  • artworks
  • tag
)
AVLTree

Sort the catalog by the given criterium

Parameters:

  • artworks Array

    an array of doq objects to be sorted

  • tag String

    the sort type

Returns:

AVLTree:

an avl tree for easy sorting

sortComparator

(
  • primary
  • secondary
)

Generates a comparator function for catalog sorting

Parameters:

  • primary String

    the primary sorting property

  • secondary String

    the secondary sorting property if left undefined, a.artwork.Identifier is used as the secondary property

sortValuation

(
  • property
)

Generates a valuation function for catalog sorting

Parameters:

  • property String

    valuation property name

switchPage

()

Switch to the artwork viewer or tour player

switchPageTour

(
  • tour
)

Switch to the tour player

Parameters:

  • tour Doq

    the relevant tour doq