View Cloud

The Workflow Carousel Library: card.handling.js Functionality

rubic-handlingBack to Workflow Carousel

The code for this part of the project is on GitHub.

Card Handling and Workflow Carousel work hand-in-hand.

Card Handling is where content is processed and presented on Cards. There is a lot of information that the developer can implement in this Framework. The majority of what is implemented is handled here.

In Card Handling, what we call cycle information is tracked. A cycle is a type of card that can repeat. The base card is the same over-and-over again with different data being presented to the user.

There are various cycle functions used in Rubik and Card Handling. They are as follows:

Function: isCycleActive(type)
Type is the type of card. This function simply determines if the card is of cycle-type and is currently active.

Function: isCycleFirst(type)
Are we on the first Card of Type in the cycle?

Function: isCycleLast(type)
Are we on the last Card of Type in the cycle?

Function: isInCycle(type)
Are we on the in the cycle and not on first or last Card of Type?

Function: stopCycleCounter(cycle)
Turn the cycle off; not Active.

In addition to the cycle functions above, there is a function to process content:

Function: ProcessContent(index, direction)
Basically, this function using the Cards and cycle information, determines which content to display on each of the five directions (current, left, right, up, and down). Current is only re-displayed if it is so indicated in the Card information.

Function: displayContent(title, direction)
This function fires the subscribed function to display the appropriate content or indicates via console.log that there is an error.

Function: calculateDirections()
This function uses Workflow Carousel CanMove information to generate a binary string indicating what direction the user can move. This information can be used to display a visual indicator using a sprite-based image.

Function: locateObject(locate)
This function loops through the Card information to get an index.
by User Not Found
11 Apr 2014
  • Workflow Carousel
  • Mobile
  • Javascript
  • Front-End
  • Development


You are not allowed to post comments.